<div id="CVS-commands"></div>
<div class="header">
<p>
Next: [[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Invoking CVS]], Previous: [[cvs: Special Files#Special Files|Special Files]], Up: [[cvs#Top|Top]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Guide-to-CVS-commands"></div>
== Guide to CVS commands ==

This appendix describes the overall structure of
<small>CVS</small> commands, and describes some commands in
detail (others are described elsewhere; for a quick
reference to <small>CVS</small> commands, see [[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Invoking CVS]]).

<div class="menu-preformatted" style="font-family: serif">
 [[#Overall structure of CVS commands|&bull; Structure]]::                   Overall structure of CVS commands
 [[#CVS&rsquo;s exit status|&bull; Exit status]]::                 Indicating CVS&rsquo;s success or failure
 [[#Default options and the ~/.cvsrc file|&bull; ~/.cvsrc]]::                    Default options with the ~/.csvrc file
 [[#Global options|&bull; Global options]]::              Options you give to the left of cvs_command
 [[#Common command options|&bull; Common options]]::              Options you give to the right of cvs_command
 [[#admin&mdash;Administration|&bull; admin]]::                       Administration
 [[#checkout&mdash;Check out sources for editing|&bull; checkout]]::                    Checkout sources for editing
 [[#commit&mdash;Check files into the repository|&bull; commit]]::                      Check files into the repository
 [[#diff&mdash;Show differences between revisions|&bull; diff]]::                        Show differences between revisions
 [[#export&mdash;Export sources from CVS, similar to checkout|&bull; export]]::                      Export sources from CVS, similar to checkout
 [[#history&mdash;Show status of files and users|&bull; history]]::                     Show status of files and users
 [[#import&mdash;Import sources into CVS, using vendor branches|&bull; import]]::                      Import sources into CVS, using vendor branches
 [[#log&mdash;Print out log information for files|&bull; log]]::                         Show log messages for files
 [[#rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases|&bull; rdiff]]::                       &rsquo;patch&rsquo; format diffs between releases
 [[#release&mdash;Indicate that a Module is no longer in use|&bull; release]]::                     Indicate that a directory is no longer in use
 [[#update&mdash;Bring work tree in sync with repository|&bull; update]]::                      Bring work tree in sync with repository
</div>


----

<div id="Structure"></div>
<div class="header">
<p>
Next: [[#CVS&rsquo;s exit status|Exit status]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Overall-structure-of-CVS-commands"></div>
=== Overall structure of CVS commands ===
<div id="index-Structure"></div>
<div id="index-CVS-command-structure"></div>
<div id="index-Command-structure"></div>
<div id="index-Format-of-CVS-commands"></div>

The overall format of all <small>CVS</small> commands is:

<div class="example" style="margin-left: 3.2em">
 cvs <nowiki>[</nowiki> cvs_options <nowiki>]</nowiki> cvs_command <nowiki>[</nowiki> command_options <nowiki>]</nowiki> <nowiki>[</nowiki> command_args <nowiki>]</nowiki>
</div>

;<code>cvs</code>
: The name of the <small>CVS</small> program.

;<code>cvs_options</code>
: Some options that affect all sub-commands of <small>CVS</small>.  These are described below.

;<code>cvs_command</code>
: One of several different sub-commands.  Some of the commands have aliases that can be used instead; those aliases are noted in the reference manual for that command.  There are only two situations where you may omit &lsquo;<code>cvs_command</code>&rsquo;: &lsquo;<code>cvs -H</code>&rsquo; elicits a list of available commands, and &lsquo;<code>cvs -v</code>&rsquo; displays version information on <small>CVS</small> itself.

;<code>command_options</code>
: Options that are specific for the command.

;<code>command_args</code>
: Arguments to the commands.

There is unfortunately some confusion between
<code>cvs_options</code> and <code>command_options</code>.
&lsquo;<code>-l</code>&rsquo;, when given as a <code>cvs_option</code>, only
affects some of the commands.  When it is given as a
<code>command_option</code> is has a different meaning, and
is accepted by more commands.  In other words, do not
take the above categorization too seriously.  Look at
the documentation instead.


----

<div id="Exit-status"></div>
<div class="header">
<p>
Next: [[#Default options and the ~/.cvsrc file|~/.cvsrc]], Previous: [[#Overall structure of CVS commands|Structure]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="CVS_0027s-exit-status"></div>
=== CVS&rsquo;s exit status ===
<div id="index-Exit-status_002c-of-CVS"></div>

<small>CVS</small> can indicate to the calling environment whether it
succeeded or failed by setting its <em>exit status</em>.
The exact way of testing the exit status will vary from
one operating system to another.  For example in a unix
shell script the &lsquo;<code>$?</code>&rsquo; variable will be 0 if the
last command returned a successful exit status, or
greater than 0 if the exit status indicated failure.

If <small>CVS</small> is successful, it returns a successful status;
if there is an error, it prints an error message and
returns a failure status.  The one exception to this is
the <code>cvs diff</code> command.  It will return a
successful status if it found no differences, or a
failure status if there were differences or if there
was an error.  Because this behavior provides no good
way to detect errors, in the future it is possible that
<code>cvs diff</code> will be changed to behave like the
other <small>CVS</small> commands.


----

<div id="g_t_007e_002f_002ecvsrc"></div>
<div class="header">
<p>
Next: [[#Global options|Global options]], Previous: [[#CVS&rsquo;s exit status|Exit status]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Default-options-and-the-_007e_002f_002ecvsrc-file"></div>
=== Default options and the ~/.cvsrc file ===
<div id="index-_002ecvsrc-file"></div>
<div id="index-Option-defaults"></div>

There are some <code>command_options</code> that are used so
often that you might have set up an alias or some other
means to make sure you always specify that option.  One
example (the one that drove the implementation of the
&lsquo;<tt>.cvsrc</tt>&rsquo; support, actually) is that many people find the
default output of the &lsquo;<code>diff</code>&rsquo; command to be very
hard to read, and that either context diffs or unidiffs
are much easier to understand.

The &lsquo;<tt>~/.cvsrc</tt>&rsquo; file is a way that you can add
default options to <code>cvs_commands</code> within cvs,
instead of relying on aliases or other shell scripts.

The format of the &lsquo;<tt>~/.cvsrc</tt>&rsquo; file is simple.  The
file is searched for a line that begins with the same
name as the <code>cvs_command</code> being executed.  If a
match is found, then the remainder of the line is split
up (at whitespace characters) into separate options and
added to the command arguments ''before'' any
options from the command line.

If a command has two names (e.g., <code>checkout</code> and
<code>co</code>), the official name, not necessarily the one
used on the command line, will be used to match against
the file.  So if this is the contents of the user&rsquo;s
&lsquo;<tt>~/.cvsrc</tt>&rsquo; file:

<div class="example" style="margin-left: 3.2em">
 log -N
 diff -uN
 rdiff -u
 update -Pd
 checkout -P
 release -d
</div>

the command &lsquo;<code>cvs checkout foo</code>&rsquo; would have the
&lsquo;<code>-P</code>&rsquo; option added to the arguments, as well as
&lsquo;<code>cvs co foo</code>&rsquo;.

With the example file above, the output from &lsquo;<code>cvs
diff foobar</code>&rsquo; will be in unidiff format.  &lsquo;<code>cvs diff
-c foobar</code>&rsquo; will provide context diffs, as usual.
Getting &quot;old&quot; format diffs would be slightly more
complicated, because <code>diff</code> doesn&rsquo;t have an option
to specify use of the &quot;old&quot; format, so you would need
&lsquo;<code>cvs -f diff foobar</code>&rsquo;.

In place of the command name you can use <code>cvs</code> to
specify global options (see [[#Global options|Global options]]).  For
example the following line in &lsquo;<tt>.cvsrc</tt>&rsquo;

<div class="example" style="margin-left: 3.2em">
 cvs -z6
</div>

causes <small>CVS</small> to use compression level 6.


----

<div id="Global-options"></div>
<div class="header">
<p>
Next: [[#Common command options|Common options]], Previous: [[#Default options and the ~/.cvsrc file|~/.cvsrc]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Global-options-1"></div>
=== Global options ===
<div id="index-Options_002c-global"></div>
<div id="index-Global-options"></div>
<div id="index-Left_002dhand-options"></div>

The available &lsquo;<code>cvs_options</code>&rsquo; (that are given to the
left of &lsquo;<code>cvs_command</code>&rsquo;) are:

;<code>--allow-root=<var>rootdir</var></code>
: Specify legal <small>CVSROOT</small> directory.  See [[cvs: The Repository#Setting up the server for password authentication|Password authentication server]].

<div id="index-Authentication_002c-stream"></div>
<div id="index-Stream-authentication"></div>
;<code>-a</code>
: Authenticate all communication between the client and the server.  Only has an effect on the <small>CVS</small> client. As of this writing, this is only implemented when using a GSSAPI connection (see [[cvs: The Repository#Direct connection with GSSAPI|GSSAPI authenticated]]). Authentication prevents certain sorts of attacks involving hijacking the active <small>TCP</small> connection. Enabling authentication does not enable encryption.

<div id="index-RCSBIN_002c-overriding"></div>
<div id="index-Overriding-RCSBIN"></div>
;<code>-b <var>bindir</var></code>
: In <small>CVS</small> 1.9.18 and older, this specified that <small>RCS</small> programs are in the <var>bindir</var> directory. Current versions of <small>CVS</small> do not run <small>RCS</small> programs; for compatibility this option is accepted, but it does nothing.

<div id="index-TMPDIR_002c-overriding"></div>
<div id="index-Overriding-TMPDIR"></div>
;<code>-T <var>tempdir</var></code>
: Use <var>tempdir</var> as the directory where temporary files are located.  Overrides the setting of the <code>$TMPDIR</code> environment variable and any precompiled directory.  This parameter should be specified as an absolute pathname. (When running client/server, &lsquo;<code>-T</code>&rsquo; affects only the local process; specifying &lsquo;<code>-T</code>&rsquo; for the client has no effect on the server and vice versa.)

<div id="index-CVSROOT_002c-overriding"></div>
<div id="index-Overriding-CVSROOT"></div>
;<code>-d <var>cvs_root_directory</var></code>
: Use <var>cvs_root_directory</var> as the root directory pathname of the repository.  Overrides the setting of the <code>$CVSROOT</code> environment variable.  See [[cvs: The Repository#The Repository|Repository]].

<div id="index-EDITOR_002c-overriding"></div>
<div id="index-Overriding-EDITOR"></div>
;<code>-e <var>editor</var></code>
: Use <var>editor</var> to enter revision log information.  Overrides the setting of the <code>$CVSEDITOR</code> and <code>$EDITOR</code> environment variables.  For more information, see [[cvs: Overview#Committing your changes|Committing your changes]].

;<code>-f</code>
: Do not read the &lsquo;<tt>~/.cvsrc</tt>&rsquo; file.  This option is most often used because of the non-orthogonality of the <small>CVS</small> option set.  For example, the &lsquo;<code>cvs log</code>&rsquo; option &lsquo;<code>-N</code>&rsquo; (turn off display of tag names) does not have a corresponding option to turn the display on.  So if you have &lsquo;<code>-N</code>&rsquo; in the &lsquo;<tt>~/.cvsrc</tt>&rsquo; entry for &lsquo;<code>log</code>&rsquo;, you may need to use &lsquo;<code>-f</code>&rsquo; to show the tag names.

;<code>-H</code>
;<code>--help</code>
: Display usage information about the specified &lsquo;<code>cvs_command</code>&rsquo; (but do not actually execute the command).  If you don&rsquo;t specify a command name, &lsquo;<code>cvs -H</code>&rsquo; displays overall help for <small>CVS</small>, including a list of other help options.

;<code>-l</code>
: Do not log the &lsquo;<code>cvs_command</code>&rsquo; in the command history (but execute it anyway).  See [[#history&mdash;Show status of files and users|history]], for information on command history.

<div id="index-Read_002donly-repository-mode"></div>
;<code>-R</code>
: Turns on read-only repository mode.  This allows one to check out from a read-only repository, such as within an anoncvs server, or from a CDROM repository.

: Same effect as if the <code>CVSREADONLYFS</code> environment variable is set. Using &lsquo;<code>-R</code>&rsquo; can also considerably speed up checkout&rsquo;s over NFS.

<div id="index-Read_002donly-mode"></div>
;<code>-n</code>
: Do not change any files.  Attempt to execute the &lsquo;<code>cvs_command</code>&rsquo;, but only to issue reports; do not remove, update, or merge any existing files, or create any new files.

: Note that <small>CVS</small> will not necessarily produce exactly the same output as without &lsquo;<code>-n</code>&rsquo;.  In some cases the output will be the same, but in other cases <small>CVS</small> will skip some of the processing that would have been required to produce the exact same output.

;<code>-Q</code>
: Cause the command to be really quiet; the command will only generate output for serious problems.

;<code>-q</code>
: Cause the command to be somewhat quiet; informational messages, such as reports of recursion through subdirectories, are suppressed.

<div id="index-Read_002donly-files_002c-and-_002dr"></div>
;<code>-r</code>
: Make new working files read-only.  Same effect as if the <code>$CVSREAD</code> environment variable is set (see [[cvs: All environment variables which affect CVS#All environment variables which affect CVS|Environment variables]]).  The default is to make working files writable, unless watches are on (see [[cvs: Multiple developers#Mechanisms to track who is editing files|Watches]]).

;<code>-s <var>variable</var>=<var>value</var></code>
: Set a user variable (see [[cvs: Reference manual for Administrative files#Expansions in administrative files|Variables]]).

<div id="index-Trace"></div>
;<code>-t</code>
: Trace program execution; display messages showing the steps of <small>CVS</small> activity.  Particularly useful with &lsquo;<code>-n</code>&rsquo; to explore the potential impact of an unfamiliar command.

;<code>-v</code>
;<code>--version</code>
: Display version and copyright information for <small>CVS</small>.

<div id="index-CVSREAD_002c-overriding"></div>
<div id="index-Overriding-CVSREAD"></div>
;<code>-w</code>
: Make new working files read-write.  Overrides the setting of the <code>$CVSREAD</code> environment variable. Files are created read-write by default, unless <code>$CVSREAD</code> is set or &lsquo;<code>-r</code>&rsquo; is given.

;<code>-x</code>
<div id="index-Encryption"></div>
: Encrypt all communication between the client and the server.  Only has an effect on the <small>CVS</small> client.  As of this writing, this is only implemented when using a GSSAPI connection (see [[cvs: The Repository#Direct connection with GSSAPI|GSSAPI authenticated]]) or a Kerberos connection (see [[cvs: The Repository#Direct connection with kerberos|Kerberos authenticated]]). Enabling encryption implies that message traffic is also authenticated.  Encryption support is not available by default; it must be enabled using a special configure option, &lsquo;<tt>--enable-encryption</tt>&rsquo;, when you build <small>CVS</small>.

;<code>-z <var>gzip-level</var></code>
<div id="index-Compression"></div>
<div id="index-Gzip"></div>
: Set the compression level. Valid levels are 1 (high speed, low compression) to 9 (low speed, high compression), or 0 to disable compression (the default). Only has an effect on the <small>CVS</small> client.



----

<div id="Common-options"></div>
<div class="header">
<p>
Next: [[#admin&mdash;Administration|admin]], Previous: [[#Global options|Global options]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Common-command-options"></div>
=== Common command options ===
<div id="index-Common-options"></div>
<div id="index-Right_002dhand-options"></div>

This section describes the &lsquo;<code>command_options</code>&rsquo; that
are available across several <small>CVS</small> commands.  These
options are always given to the right of
&lsquo;<code>cvs_command</code>&rsquo;. Not all
commands support all of these options; each option is
only supported for commands where it makes sense.
However, when a command has one of these options you
can almost always count on the same behavior of the
option as in other commands.  (Other command options,
which are listed with the individual commands, may have
different behavior from one <small>CVS</small> command to the other).

'''Note: the &lsquo;<code>history</code>&rsquo; command is an exception; it supports
many options that conflict even with these standard options.'''

<div id="index-Dates"></div>
<div id="index-Time"></div>
<div id="index-Specifying-dates"></div>
;<code>-D <var>date_spec</var></code>
: Use the most recent revision no later than <var>date_spec</var>. <var>date_spec</var> is a single argument, a date description specifying a date in the past.

: The specification is <em>sticky</em> when you use it to make a private copy of a source file; that is, when you get a working file using &lsquo;<code>-D</code>&rsquo;, <small>CVS</small> records the date you specified, so that further updates in the same directory will use the same date (for more information on sticky tags/dates, see [[cvs: Revisions#Sticky tags|Sticky tags]]).

: &lsquo;<code>-D</code>&rsquo; is available with the <code>annotate</code>, <code>checkout</code>, <code>diff</code>, <code>export</code>, <code>history</code>, <code>rdiff</code>, <code>rtag</code>, <code>tag</code>, and <code>update</code> commands. (The <code>history</code> command uses this option in a slightly different way; see [[#history options|history options]]).


<div id="index-Timezone_002c-in-input"></div>
<div id="index-Zone_002c-time_002c-in-input"></div>
: A wide variety of date formats are supported by <small>CVS</small>.  The most standard ones are ISO8601 (from the International Standards Organization) and the Internet e-mail standard (specified in RFC822 as amended by RFC1123).

: ISO8601 dates have many variants but a few examples are:

<div class="example" style="margin-left: 3.2em">
 1972-09-24
 1972-09-24 20:05
</div>

: There are a lot more ISO8601 date formats, and <small>CVS</small> accepts many of them, but you probably don&rsquo;t want to hear the ''whole'' long story<nowiki> :</nowiki>-).


: In addition to the dates allowed in Internet e-mail itself, <small>CVS</small> also allows some of the fields to be omitted.  For example:

<div class="example" style="margin-left: 3.2em">
 24 Sep 1972 20:05
 24 Sep
</div>

: The date is interpreted as being in the local timezone, unless a specific timezone is specified.

: These two date formats are preferred.  However, <small>CVS</small> currently accepts a wide variety of other date formats.  They are intentionally not documented here in any detail, and future versions of <small>CVS</small> might not accept all of them.

: One such format is <code><var>month</var>/<var>day</var>/<var>year</var></code>.  This may confuse people who are accustomed to having the month and day in the other order; &lsquo;<code>1/4/96</code>&rsquo; is January 4, not April 1.

: Remember to quote the argument to the &lsquo;<code>-D</code>&rsquo; flag so that your shell doesn&rsquo;t interpret spaces as argument separators.  A command using the &lsquo;<code>-D</code>&rsquo; flag can look like this:

<div class="example" style="margin-left: 3.2em">
 $ cvs diff -D &quot;1 hour ago&quot; cvs.texinfo
</div>

<div id="index-Forcing-a-tag-match"></div>
;<code>-f</code>
: When you specify a particular date or tag to <small>CVS</small> commands, they normally ignore files that do not contain the tag (or did not exist prior to the date) that you specified.  Use the &lsquo;<code>-f</code>&rsquo; option if you want files retrieved even when there is no match for the tag or date.  (The most recent revision of the file will be used).

: Note that even with &lsquo;<code>-f</code>&rsquo;, a tag that you specify must exist (that is, in some file, not necessary in every file).  This is so that <small>CVS</small> will continue to give an error if you mistype a tag name.

: &lsquo;<code>-f</code>&rsquo; is available with these commands: <code>annotate</code>, <code>checkout</code>, <code>export</code>, <code>rdiff</code>, <code>rtag</code>, and <code>update</code>.

: '''WARNING:  The <code>commit</code> and <code>remove</code> commands also have a &lsquo;<code>-f</code>&rsquo; option, but it has a different behavior for those commands.  See [[#commit options|commit options]], and [[cvs: Adding, removing, and renaming files and directories#Removing files|Removing files]].'''

;<code>-k <var>kflag</var></code>
: Override the default processing of RCS keywords other than &lsquo;<code>-kb</code>&rsquo;.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]], for the meaning of <var>kflag</var>.  Used with the <code>checkout</code> and <code>update</code> commands, your <var>kflag</var> specification is <em>sticky</em>; that is, when you use this option with a <code>checkout</code> or <code>update</code> command, <small>CVS</small> associates your selected <var>kflag</var> with any files it operates on, and continues to use that <var>kflag</var> with future commands on the same files until you specify otherwise.

: The &lsquo;<code>-k</code>&rsquo; option is available with the <code>add</code>, <code>checkout</code>, <code>diff</code>, <code>export</code>, <code>import</code> and <code>update</code> commands.

: '''WARNING: Prior to CVS version 1.12.2, the &lsquo;<code>-k</code>&rsquo; flag overrode the &lsquo;<code>-kb</code>&rsquo; indication for a binary file.  This could sometimes corrupt binary files.  See [[cvs: Branching and merging#Merging and keywords|Merging and keywords]], for more.'''

;<code>-l</code>
: Local; run only in current working directory, rather than recursing through subdirectories.

: Available with the following commands: <code>annotate</code>, <code>checkout</code>, <code>commit</code>, <code>diff</code>, <code>edit</code>, <code>editors</code>, <code>export</code>, <code>log</code>, <code>rdiff</code>, <code>remove</code>, <code>rtag</code>, <code>status</code>, <code>tag</code>, <code>unedit</code>, <code>update</code>, <code>watch</code>, and <code>watchers</code>.

<div id="index-Editor_002c-avoiding-invocation-of"></div>
<div id="index-Avoiding-editor-invocation"></div>
;<code>-m <var>message</var></code>
: Use <var>message</var> as log information, instead of invoking an editor.

: Available with the following commands: <code>add</code>, <code>commit</code> and <code>import</code>.

;<code>-n</code>
: Do not run any tag program.  (A program can be specified to run in the modules database (see [[cvs: Reference manual for Administrative files#The modules file|modules]]); this option bypasses it).

: '''Note: this is not the same as the &lsquo;<code>cvs -n</code>&rsquo; program option, which you can specify to the left of a cvs command!'''

: Available with the <code>checkout</code>, <code>commit</code>, <code>export</code>, and <code>rtag</code> commands.

;<code>-P</code>
: Prune empty directories.  See [[cvs: Adding, removing, and renaming files and directories#Removing directories|Removing directories]].

;<code>-p</code>
: Pipe the files retrieved from the repository to standard output, rather than writing them in the current directory.  Available with the <code>checkout</code> and <code>update</code> commands.

;<code>-R</code>
: Process directories recursively.  This is on by default.

: Available with the following commands: <code>annotate</code>, <code>checkout</code>, <code>commit</code>, <code>diff</code>, <code>edit</code>, <code>editors</code>, <code>export</code>, <code>rdiff</code>, <code>remove</code>, <code>rtag</code>, <code>status</code>, <code>tag</code>, <code>unedit</code>, <code>update</code>, <code>watch</code>, and <code>watchers</code>.

;<code>-r <var>tag</var></code>
<div id="index-HEAD_002c-special-tag"></div>
<div id="index-BASE_002c-special-tag"></div>
: Use the revision specified by the <var>tag</var> argument instead of the default <em>head</em> revision.  As well as arbitrary tags defined with the <code>tag</code> or <code>rtag</code> command, two special tags are always available: &lsquo;<code>HEAD</code>&rsquo; refers to the most recent version available in the repository, and &lsquo;<code>BASE</code>&rsquo; refers to the revision you last checked out into the current working directory.


: The tag specification is sticky when you use this with <code>checkout</code> or <code>update</code> to make your own copy of a file: <small>CVS</small> remembers the tag and continues to use it on future update commands, until you specify otherwise (for more information on sticky tags/dates, see [[cvs: Revisions#Sticky tags|Sticky tags]]).

: The tag can be either a symbolic or numeric tag, as described in [[cvs: Revisions#Tags&ndash;Symbolic revisions|Tags]], or the name of a branch, as described in [[cvs: Branching and merging#Branching and merging|Branching and merging]].

: Specifying the &lsquo;<code>-q</code>&rsquo; global option along with the &lsquo;<code>-r</code>&rsquo; command option is often useful, to suppress the warning messages when the <small>RCS</small> file does not contain the specified tag.

: '''Note: this is not the same as the overall &lsquo;<code>cvs -r</code>&rsquo; option, which you can specify to the left of a <small>CVS</small> command!'''

: &lsquo;<code>-r</code>&rsquo; is available with the <code>checkout</code>, <code>commit</code>, <code>diff</code>, <code>history</code>, <code>export</code>, <code>rdiff</code>, <code>rtag</code>, and <code>update</code> commands.

;<code>-W</code>
: Specify file names that should be filtered.  You can use this option repeatedly.  The spec can be a file name pattern of the same type that you can specify in the &lsquo;<tt>.cvswrappers</tt>&rsquo; file. Available with the following commands: <code>import</code>, and <code>update</code>.



----

<div id="admin"></div>
<div class="header">
<p>
Next: [[#checkout&mdash;Check out sources for editing|checkout]], Previous: [[#Common command options|Common options]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="admin_002d_002d_002dAdministration"></div>
=== admin&mdash;Administration ===
<div id="index-Admin-_0028subcommand_0029"></div>


* Requires: repository, working directory.

* Changes: repository.

* Synonym: rcs

This is the <small>CVS</small> interface to assorted
administrative facilities.  Some of them have
questionable usefulness for <small>CVS</small> but exist for
historical purposes.  Some of the questionable options
are likely to disappear in the future.  This command
''does'' work recursively, so extreme care should be
used.

<div id="index-cvsadmin"></div>
<div id="index-UserAdminOptions_002c-in-CVSROOT_002fconfig"></div>
On unix, if there is a group named <code>cvsadmin</code>,
only members of that group can run <code>cvs admin</code>
commands, except for those specified using the
<code>UserAdminOptions</code> configuration option in the
&lsquo;<tt>CVSROOT/config</tt>&rsquo; file.  Options specified using
<code>UserAdminOptions</code> can be run by any user.  See
[[cvs: Reference manual for Administrative files#The CVSROOT/config configuration file|config]] for more on <code>UserAdminOptions</code>.

The <code>cvsadmin</code> group should exist on the server,
or any system running the non-client/server <small>CVS</small>.
To disallow <code>cvs admin</code> for all users, create a
group with no users in it.  On NT, the <code>cvsadmin</code>
feature does not exist and all users
can run <code>cvs admin</code>.

<div class="menu-preformatted" style="font-family: serif">
 [[#admin options|&bull; admin options]]::               admin options
</div>


----

<div id="admin-options"></div>
<div class="header">
<p>
Up: [[#admin&mdash;Administration|admin]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="admin-options-1"></div>
==== admin options ====

Some of these options have questionable usefulness for
<small>CVS</small> but exist for historical purposes.  Some even
make it impossible to use <small>CVS</small> until you undo the
effect!

;<code>-A<var>oldfile</var></code>
: Might not work together with <small>CVS</small>.  Append the access list of <var>oldfile</var> to the access list of the <small>RCS</small> file.

;<code>-a<var>logins</var></code>
: Might not work together with <small>CVS</small>.  Append the login names appearing in the comma-separated list <var>logins</var> to the access list of the <small>RCS</small> file.

;<code>-b<nowiki>[</nowiki><var>rev</var><nowiki>]</nowiki></code>
: Set the default branch to <var>rev</var>.  In <small>CVS</small>, you normally do not manipulate default branches; sticky tags (see [[cvs: Revisions#Sticky tags|Sticky tags]]) are a better way to decide which branch you want to work on.  There is one reason to run <code>cvs admin -b</code>: to revert to the vendor&rsquo;s version when using vendor branches (see [[cvs: Tracking third-party sources#Reverting to the latest vendor release|Reverting local changes]]). There can be no space between &lsquo;<code>-b</code>&rsquo; and its argument.

<div id="index-Comment-leader"></div>
;<code>-c<var>string</var></code>
: Sets the comment leader to <var>string</var>.  The comment leader is not used by current versions of <small>CVS</small> or <small>RCS</small> 5.7.  Therefore, you can almost surely not worry about it.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]].

;<code>-e<nowiki>[</nowiki><var>logins</var><nowiki>]</nowiki></code>
: Might not work together with <small>CVS</small>.  Erase the login names appearing in the comma-separated list <var>logins</var> from the access list of the RCS file.  If <var>logins</var> is omitted, erase the entire access list. There can be no space between &lsquo;<code>-e</code>&rsquo; and its argument.

;<code>-I</code>
: Run interactively, even if the standard input is not a terminal.  This option does not work with the client/server <small>CVS</small> and is likely to disappear in a future release of <small>CVS</small>.

;<code>-i</code>
: Useless with <small>CVS</small>.  This creates and initializes a new <small>RCS</small> file, without depositing a revision.  With <small>CVS</small>, add files with the <code>cvs add</code> command (see [[cvs: Adding, removing, and renaming files and directories#Adding files to a directory|Adding files]]).

;<code>-k<var>subst</var></code>
: Set the default keyword substitution to <var>subst</var>.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]].  Giving an explicit &lsquo;<code>-k</code>&rsquo; option to <code>cvs update</code>, <code>cvs export</code>, or <code>cvs checkout</code> overrides this default.

;<code>-l<nowiki>[</nowiki><var>rev</var><nowiki>]</nowiki></code>
: Lock the revision with number <var>rev</var>.  If a branch is given, lock the latest revision on that branch.  If <var>rev</var> is omitted, lock the latest revision on the default branch.  There can be no space between &lsquo;<code>-l</code>&rsquo; and its argument.

: This can be used in conjunction with the &lsquo;<tt>rcslock.pl</tt>&rsquo; script in the &lsquo;<tt>contrib</tt>&rsquo; directory of the <small>CVS</small> source distribution to provide reserved checkouts (where only one user can be editing a given file at a time).  See the comments in that file for details (and see the &lsquo;<tt>README</tt>&rsquo; file in that directory for disclaimers about the unsupported nature of contrib).  According to comments in that file, locking must set to strict (which is the default).

;<code>-L</code>
: Set locking to strict.  Strict locking means that the owner of an RCS file is not exempt from locking for checkin.  For use with <small>CVS</small>, strict locking must be set; see the discussion under the &lsquo;<code>-l</code>&rsquo; option above.

<div id="index-Changing-a-log-message"></div>
<div id="index-Replacing-a-log-message"></div>
<div id="index-Correcting-a-log-message"></div>
<div id="index-Fixing-a-log-message"></div>
<div id="index-Log-message_002c-correcting"></div>
;<code>-m<var>rev</var>:<var>msg</var></code>
: Replace the log message of revision <var>rev</var> with <var>msg</var>.


;<code>-N<var>name</var><nowiki>[</nowiki>:<nowiki>[</nowiki><var>rev</var><nowiki>]]</nowiki></code>
: Act like &lsquo;<code>-n</code>&rsquo;, except override any previous assignment of <var>name</var>.  For use with magic branches, see [[cvs: Branching and merging#Magic branch numbers|Magic branch numbers]].

;<code>-n<var>name</var><nowiki>[</nowiki>:<nowiki>[</nowiki><var>rev</var><nowiki>]]</nowiki></code>
: Associate the symbolic name <var>name</var> with the branch or revision <var>rev</var>.  It is normally better to use &lsquo;<code>cvs tag</code>&rsquo; or &lsquo;<code>cvs rtag</code>&rsquo; instead.  Delete the symbolic name if both &lsquo;<code>:</code>&rsquo; and <var>rev</var> are omitted; otherwise, print an error message if <var>name</var> is already associated with another number. If <var>rev</var> is symbolic, it is expanded before association.  A <var>rev</var> consisting of a branch number followed by a &lsquo;<code>.</code>&rsquo; stands for the current latest revision in the branch.  A &lsquo;<code>:</code>&rsquo; with an empty <var>rev</var> stands for the current latest revision on the default branch, normally the trunk.  For example, &lsquo;<code>cvs admin -n<var>name</var>:</code>&rsquo; associates <var>name</var> with the current latest revision of all the RCS files; this contrasts with &lsquo;<code>cvs admin -n<var>name</var>:$</code>&rsquo; which associates <var>name</var> with the revision numbers extracted from keyword strings in the corresponding working files.

<div id="index-Deleting-revisions"></div>
<div id="index-Outdating-revisions"></div>
<div id="index-Saving-space"></div>
;<code>-o<var>range</var></code>
: Deletes (<em>outdates</em>) the revisions given by <var>range</var>.

: Note that this command can be quite dangerous unless you know ''exactly'' what you are doing (for example see the warnings below about how the <var>rev1</var>:<var>rev2</var> syntax is confusing).

: If you are short on disc this option might help you. But think twice before using it&mdash;there is no way short of restoring the latest backup to undo this command! If you delete different revisions than you planned, either due to carelessness or (heaven forbid) a <small>CVS</small> bug, there is no opportunity to correct the error before the revisions are deleted.  It probably would be a good idea to experiment on a copy of the repository first.

: Specify <var>range</var> in one of the following ways:

:;<code><var>rev1</var>::<var>rev2</var></code>
:: Collapse all revisions between rev1 and rev2, so that <small>CVS</small> only stores the differences associated with going from rev1 to rev2, not intermediate steps.  For example, after &lsquo;<code>-o 1.3::1.5</code>&rsquo; one can retrieve revision 1.3, revision 1.5, or the differences to get from 1.3 to 1.5, but not the revision 1.4, or the differences between 1.3 and 1.4.  Other examples: &lsquo;<code>-o 1.3::1.4</code>&rsquo; and &lsquo;<code>-o 1.3::1.3</code>&rsquo; have no effect, because there are no intermediate revisions to remove.

:;<code>::<var>rev</var></code>
:: Collapse revisions between the beginning of the branch containing <var>rev</var> and <var>rev</var> itself.  The branchpoint and <var>rev</var> are left intact.  For example, &lsquo;<code>-o<nowiki> :</nowiki>:1.3.2.6</code>&rsquo; deletes revision 1.3.2.1, revision 1.3.2.5, and everything in between, but leaves 1.3 and 1.3.2.6 intact.

:;<code><var>rev</var>::</code>
:: Collapse revisions between <var>rev</var> and the end of the branch containing <var>rev</var>.  Revision <var>rev</var> is left intact but the head revision is deleted.

:;<code><var>rev</var></code>
:: Delete the revision <var>rev</var>.  For example, &lsquo;<code>-o 1.3</code>&rsquo; is equivalent to &lsquo;<code>-o 1.2::1.4</code>&rsquo;.

:;<code><var>rev1</var>:<var>rev2</var></code>
:: Delete the revisions from <var>rev1</var> to <var>rev2</var>, inclusive, on the same branch.  One will not be able to retrieve <var>rev1</var> or <var>rev2</var> or any of the revisions in between.  For example, the command &lsquo;<code>cvs admin -oR_1_01:R_1_02 .</code>&rsquo; is rarely useful. It means to delete revisions up to, and including, the tag R_1_02.  But beware!  If there are files that have not changed between R_1_02 and R_1_03 the file will have ''the same'' numerical revision number assigned to the tags R_1_02 and R_1_03.  So not only will it be impossible to retrieve R_1_02; R_1_03 will also have to be restored from the tapes!  In most cases you want to specify <var>rev1</var>::<var>rev2</var> instead.

:;<code>:<var>rev</var></code>
:: Delete revisions from the beginning of the branch containing <var>rev</var> up to and including <var>rev</var>.

:;<code><var>rev</var>:</code>
:: Delete revisions from revision <var>rev</var>, including <var>rev</var> itself, to the end of the branch containing <var>rev</var>.

: None of the revisions to be deleted may have branches or locks.

: If any of the revisions to be deleted have symbolic names, and one specifies one of the &lsquo;<code>::</code>&rsquo; syntaxes, then <small>CVS</small> will give an error and not delete any revisions.  If you really want to delete both the symbolic names and the revisions, first delete the symbolic names with <code>cvs tag -d</code>, then run <code>cvs admin -o</code>.  If one specifies the non-&lsquo;<code>::</code>&rsquo; syntaxes, then <small>CVS</small> will delete the revisions but leave the symbolic names pointing to nonexistent revisions.  This behavior is preserved for compatibility with previous versions of <small>CVS</small>, but because it isn&rsquo;t very useful, in the future it may change to be like the &lsquo;<code>::</code>&rsquo; case.

: Due to the way <small>CVS</small> handles branches <var>rev</var> cannot be specified symbolically if it is a branch. See [[cvs: Branching and merging#Magic branch numbers|Magic branch numbers]], for an explanation.

: Make sure that no-one has checked out a copy of the revision you outdate.  Strange things will happen if he starts to edit it and tries to check it back in.  For this reason, this option is not a good way to take back a bogus commit; commit a new revision undoing the bogus change instead (see [[cvs: Branching and merging#Merging differences between any two revisions|Merging two revisions]]).

;<code>-q</code>
: Run quietly; do not print diagnostics.

;<code>-s<var>state</var><nowiki>[</nowiki>:<var>rev</var><nowiki>]</nowiki></code>
: Useful with <small>CVS</small>.  Set the state attribute of the revision <var>rev</var> to <var>state</var>.  If <var>rev</var> is a branch number, assume the latest revision on that branch.  If <var>rev</var> is omitted, assume the latest revision on the default branch.  Any identifier is acceptable for <var>state</var>.  A useful set of states is &lsquo;<code>Exp</code>&rsquo; (for experimental), &lsquo;<code>Stab</code>&rsquo; (for stable), and &lsquo;<code>Rel</code>&rsquo; (for released).  By default, the state of a new revision is set to &lsquo;<code>Exp</code>&rsquo; when it is created.  The state is visible in the output from <var>cvs log</var> (see [[#log&mdash;Print out log information for files|log]]), and in the &lsquo;<code>$<i></i>Log$</code>&rsquo; and &lsquo;<code>$<i></i>State$</code>&rsquo; keywords (see [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]]).  Note that <small>CVS</small> uses the <code>dead</code> state for its own purposes; to take a file to or from the <code>dead</code> state use commands like <code>cvs remove</code> and <code>cvs add</code>, not <code>cvs admin -s</code>.

;<code>-t<nowiki>[</nowiki><var>file</var><nowiki>]</nowiki></code>
: Useful with <small>CVS</small>.  Write descriptive text from the contents of the named <var>file</var> into the RCS file, deleting the existing text.  The <var>file</var> pathname may not begin with &lsquo;<code>-</code>&rsquo;.  The descriptive text can be seen in the output from &lsquo;<code>cvs log</code>&rsquo; (see [[#log&mdash;Print out log information for files|log]]). There can be no space between &lsquo;<code>-t</code>&rsquo; and its argument.

: If <var>file</var> is omitted, obtain the text from standard input, terminated by end-of-file or by a line containing &lsquo;<code>.</code>&rsquo; by itself. Prompt for the text if interaction is possible; see &lsquo;<code>-I</code>&rsquo;.

;<code>-t-<var>string</var></code>
: Similar to &lsquo;<code>-t<var>file</var></code>&rsquo;. Write descriptive text from the <var>string</var> into the <small>RCS</small> file, deleting the existing text. There can be no space between &lsquo;<code>-t</code>&rsquo; and its argument.


;<code>-U</code>
: Set locking to non-strict.  Non-strict locking means that the owner of a file need not lock a revision for checkin.  For use with <small>CVS</small>, strict locking must be set; see the discussion under the &lsquo;<code>-l</code>&rsquo; option above.

;<code>-u<nowiki>[</nowiki><var>rev</var><nowiki>]</nowiki></code>
: See the option &lsquo;<code>-l</code>&rsquo; above, for a discussion of using this option with <small>CVS</small>.  Unlock the revision with number <var>rev</var>.  If a branch is given, unlock the latest revision on that branch.  If <var>rev</var> is omitted, remove the latest lock held by the caller. Normally, only the locker of a revision may unlock it; somebody else unlocking a revision breaks the lock. This causes the original locker to be sent a <code>commit</code> notification (see [[cvs: Multiple developers#Telling CVS to notify you|Getting Notified]]). There can be no space between &lsquo;<code>-u</code>&rsquo; and its argument.

;<code>-V<var>n</var></code>
: In previous versions of <small>CVS</small>, this option meant to write an <small>RCS</small> file which would be acceptable to <small>RCS</small> version <var>n</var>, but it is now obsolete and specifying it will produce an error.

;<code>-x<var>suffixes</var></code>
: In previous versions of <small>CVS</small>, this was documented as a way of specifying the names of the <small>RCS</small> files.  However, <small>CVS</small> has always required that the <small>RCS</small> files used by <small>CVS</small> end in &lsquo;<code>,v</code>&rsquo;, so this option has never done anything useful.




----

<div id="checkout"></div>
<div class="header">
<p>
Next: [[#commit&mdash;Check files into the repository|commit]], Previous: [[#admin&mdash;Administration|admin]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="checkout_002d_002d_002dCheck-out-sources-for-editing"></div>
=== checkout&mdash;Check out sources for editing ===
<div id="index-checkout-_0028subcommand_0029"></div>
<div id="index-co-_0028subcommand_0029"></div>


* Synopsis: checkout <nowiki>[</nowiki>options<nowiki>]</nowiki> modules&hellip;

* Requires: repository.

* Changes: working directory.

* Synonyms: co, get

Create or update a working directory containing copies of the
source files specified by <var>modules</var>.  You must execute
<code>checkout</code> before using most of the other <small>CVS</small>
commands, since most of them operate on your working
directory.

The <var>modules</var> are either
symbolic names for some
collection of source directories and files, or paths to
directories or files in the repository.  The symbolic
names are defined in the &lsquo;<code>modules</code>&rsquo; file.
See [[cvs: Reference manual for Administrative files#The modules file|modules]].

Depending on the modules you specify, <code>checkout</code> may
recursively create directories and populate them with
the appropriate source files.  You can then edit these
source files at any time (regardless of whether other
software developers are editing their own copies of the
sources); update them to include new changes applied by
others to the source repository; or commit your work as
a permanent change to the source repository.

Note that <code>checkout</code> is used to create
directories.  The top-level directory created is always
added to the directory where <code>checkout</code> is
invoked, and usually has the same name as the specified
module.  In the case of a module alias, the created
sub-directory may have a different name, but you can be
sure that it will be a sub-directory, and that
<code>checkout</code> will show the relative path leading to
each file as it is extracted into your private work
area (unless you specify the &lsquo;<code>-Q</code>&rsquo; global option).

The files created by <code>checkout</code> are created
read-write, unless the &lsquo;<code>-r</code>&rsquo; option to <small>CVS</small>
(see [[#Global options|Global options]]) is specified, the
<code>CVSREAD</code> environment variable is specified
(see [[cvs: All environment variables which affect CVS#All environment variables which affect CVS|Environment variables]]), or a watch is in
effect for that file (see [[cvs: Multiple developers#Mechanisms to track who is editing files|Watches]]).

Note that running <code>checkout</code> on a directory that was already
built by a prior <code>checkout</code> is also permitted.
This is similar to specifying the &lsquo;<code>-d</code>&rsquo; option
to the <code>update</code> command in the sense that new
directories that have been created in the repository
will appear in your work area.
However, <code>checkout</code> takes a module name whereas
<code>update</code> takes a directory name.  Also
to use <code>checkout</code> this way it must be run from the
top level directory (where you originally ran
<code>checkout</code> from), so before you run
<code>checkout</code> to update an existing directory, don&rsquo;t
forget to change your directory to the top level
directory.

For the output produced by the <code>checkout</code> command
see [[#update output|update output]].

<div class="menu-preformatted" style="font-family: serif">
 [[#checkout options|&bull; checkout options]]::            checkout options
 [[#checkout examples|&bull; checkout examples]]::           checkout examples
</div>


----

<div id="checkout-options"></div>
<div class="header">
<p>
Next: [[#checkout examples|checkout examples]], Up: [[#checkout&mdash;Check out sources for editing|checkout]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="checkout-options-1"></div>
==== checkout options ====

These standard options are supported by <code>checkout</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-D <var>date</var></code>
: Use the most recent revision no later than <var>date</var>. This option is sticky, and implies &lsquo;<code>-P</code>&rsquo;.  See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

;<code>-f</code>
: Only useful with the &lsquo;<code>-D <var>date</var></code>&rsquo; or &lsquo;<code>-r <var>tag</var></code>&rsquo; flags.  If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).

;<code>-k <var>kflag</var></code>
: Process keywords according to <var>kflag</var>.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]]. This option is sticky; future updates of this file in this working directory will use the same <var>kflag</var>.  The <code>status</code> command can be viewed to see the sticky options.  See [[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Invoking CVS]], for more information on the <code>status</code> command.

;<code>-l</code>
: Local; run only in current working directory.

;<code>-n</code>
: Do not run any checkout program (as specified with the &lsquo;<code>-o</code>&rsquo; option in the modules file; see [[cvs: Reference manual for Administrative files#The modules file|modules]]).

;<code>-P</code>
: Prune empty directories.  See [[cvs: Adding, removing, and renaming files and directories#Moving and renaming directories|Moving directories]].

;<code>-p</code>
: Pipe files to the standard output.

;<code>-R</code>
: Checkout directories recursively.  This option is on by default.

;<code>-r <var>tag</var></code>
: Use revision <var>tag</var>.  This option is sticky, and implies &lsquo;<code>-P</code>&rsquo;. See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

In addition to those, you can use these special command
options with <code>checkout</code>:

;<code>-A</code>
: Reset any sticky tags, dates, or &lsquo;<code>-k</code>&rsquo; options. See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

;<code>-c</code>
: Copy the module file, sorted, to the standard output, instead of creating or modifying any files or directories in your working directory.

;<code>-d <var>dir</var></code>
: Create a directory called <var>dir</var> for the working files, instead of using the module name.  In general, using this flag is equivalent to using &lsquo;<code>mkdir <var>dir</var>; cd <var>dir</var></code>&rsquo; followed by the checkout command without the &lsquo;<code>-d</code>&rsquo; flag.

: There is an important exception, however.  It is very convenient when checking out a single item to have the output appear in a directory that doesn&rsquo;t contain empty intermediate directories.  In this case ''only'', <small>CVS</small> tries to &ldquo;shorten&rdquo; pathnames to avoid those empty directories.

: For example, given a module &lsquo;<code>foo</code>&rsquo; that contains the file &lsquo;<code>bar.c</code>&rsquo;, the command &lsquo;<code>cvs co -d dir foo</code>&rsquo; will create directory &lsquo;<code>dir</code>&rsquo; and place &lsquo;<code>bar.c</code>&rsquo; inside.  Similarly, given a module &lsquo;<code>bar</code>&rsquo; which has subdirectory &lsquo;<code>baz</code>&rsquo; wherein there is a file &lsquo;<code>quux.c</code>&rsquo;, the command &lsquo;<code>cvs co -d dir bar/baz</code>&rsquo; will create directory &lsquo;<code>dir</code>&rsquo; and place &lsquo;<code>quux.c</code>&rsquo; inside.

: Using the &lsquo;<code>-N</code>&rsquo; flag will defeat this behavior. Given the same module definitions above, &lsquo;<code>cvs co -N -d dir foo</code>&rsquo; will create directories &lsquo;<code>dir/foo</code>&rsquo; and place &lsquo;<code>bar.c</code>&rsquo; inside, while &lsquo;<code>cvs co -N -d dir bar/baz</code>&rsquo; will create directories &lsquo;<code>dir/bar/baz</code>&rsquo; and place &lsquo;<code>quux.c</code>&rsquo; inside.

;<code>-j <var>tag</var></code>
: With two &lsquo;<code>-j</code>&rsquo; options, merge changes from the revision specified with the first &lsquo;<code>-j</code>&rsquo; option to the revision specified with the second &lsquo;<code>j</code>&rsquo; option, into the working directory.

: With one &lsquo;<code>-j</code>&rsquo; option, merge changes from the ancestor revision to the revision specified with the &lsquo;<code>-j</code>&rsquo; option, into the working directory.  The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the &lsquo;<code>-j</code>&rsquo; option.

: In addition, each -j option can contain an optional date specification which, when used with branches, can limit the chosen revision to one within a specific date.  An optional date is specified by adding a colon (:) to the tag: &lsquo;<code>-j<var>Symbolic_Tag</var>:<var>Date_Specifier</var></code>&rsquo;.

: See [[cvs: Branching and merging#Branching and merging|Branching and merging]].

;<code>-N</code>
: Only useful together with &lsquo;<code>-d <var>dir</var></code>&rsquo;.  With this option, <small>CVS</small> will not &ldquo;shorten&rdquo; module paths in your working directory when you check out a single module.  See the &lsquo;<code>-d</code>&rsquo; flag for examples and a discussion.

;<code>-s</code>
: Like &lsquo;<code>-c</code>&rsquo;, but include the status of all modules, and sort it by the status string.  See [[cvs: Reference manual for Administrative files#The modules file|modules]], for info about the &lsquo;<code>-s</code>&rsquo; option that is used inside the modules file to set the module status.


----

<div id="checkout-examples"></div>
<div class="header">
<p>
Previous: [[#checkout options|checkout options]], Up: [[#checkout&mdash;Check out sources for editing|checkout]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="checkout-examples-1"></div>
==== checkout examples ====

Get a copy of the module &lsquo;<code>tc</code>&rsquo;:

<div class="example" style="margin-left: 3.2em">
 $ cvs checkout tc
</div>

Get a copy of the module &lsquo;<code>tc</code>&rsquo; as it looked one day
ago:

<div class="example" style="margin-left: 3.2em">
 $ cvs checkout -D yesterday tc
</div>


----

<div id="commit"></div>
<div class="header">
<p>
Next: [[#diff&mdash;Show differences between revisions|diff]], Previous: [[#checkout&mdash;Check out sources for editing|checkout]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="commit_002d_002d_002dCheck-files-into-the-repository"></div>
=== commit&mdash;Check files into the repository ===
<div id="index-commit-_0028subcommand_0029"></div>


* Synopsis: commit <nowiki>[</nowiki>-lnRf<nowiki>]</nowiki> <nowiki>[</nowiki>-m &rsquo;log_message&rsquo; | -F file<nowiki>]</nowiki> <nowiki>[</nowiki>-r revision<nowiki>]</nowiki> <nowiki>[</nowiki>files&hellip;<nowiki>]</nowiki>

* Requires: working directory, repository.

* Changes: repository.

* Synonym: ci

Use <code>commit</code> when you want to incorporate changes
from your working source files into the source
repository.

If you don&rsquo;t specify particular files to commit, all of
the files in your working current directory are
examined.  <code>commit</code> is careful to change in the
repository only those files that you have really
changed.  By default (or if you explicitly specify the
&lsquo;<code>-R</code>&rsquo; option), files in subdirectories are also
examined and committed if they have changed; you can
use the &lsquo;<code>-l</code>&rsquo; option to limit <code>commit</code> to the
current directory only.

<code>commit</code> verifies that the selected files are up
to date with the current revisions in the source
repository; it will notify you, and exit without
committing, if any of the specified files must be made
current first with <code>update</code> (see [[#update&mdash;Bring work tree in sync with repository|update]]).
<code>commit</code> does not call the <code>update</code> command
for you, but rather leaves that for you to do when the
time is right.

When all is well, an editor is invoked to allow you to
enter a log message that will be written to one or more
logging programs (see [[cvs: Reference manual for Administrative files#The modules file|modules]], and see [[cvs: Reference manual for Administrative files#Loginfo|loginfo]])
and placed in the <small>RCS</small> file inside the
repository.  This log message can be retrieved with the
<code>log</code> command; see [[#log&mdash;Print out log information for files|log]].  You can specify the
log message on the command line with the &lsquo;<code>-m
<var>message</var></code>&rsquo; option, and thus avoid the editor invocation,
or use the &lsquo;<code>-F <var>file</var></code>&rsquo; option to specify
that the argument file contains the log message.

<div class="menu-preformatted" style="font-family: serif">
 [[#commit options|&bull; commit options]]::              commit options
 [[#commit examples|&bull; commit examples]]::             commit examples
</div>


----

<div id="commit-options"></div>
<div class="header">
<p>
Next: [[#commit examples|commit examples]], Up: [[#commit&mdash;Check files into the repository|commit]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="commit-options-1"></div>
==== commit options ====

These standard options are supported by <code>commit</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-l</code>
: Local; run only in current working directory.

;<code>-R</code>
: Commit directories recursively.  This is on by default.

;<code>-r <var>revision</var></code>
: Commit to <var>revision</var>.  <var>revision</var> must be either a branch, or a revision on the main trunk that is higher than any existing revision number (see [[cvs: Revisions#Assigning revisions|Assigning revisions]]).  You cannot commit to a specific revision on a branch.

<code>commit</code> also supports these options:

;<code>-F <var>file</var></code>
: Read the log message from <var>file</var>, instead of invoking an editor.

;<code>-f</code>
: Note that this is not the standard behavior of the &lsquo;<code>-f</code>&rsquo; option as defined in [[#Common command options|Common options]].

: Force <small>CVS</small> to commit a new revision even if you haven&rsquo;t made any changes to the file.  If the current revision of <var>file</var> is 1.7, then the following two commands are equivalent:

<div class="example" style="margin-left: 3.2em">
 $ cvs commit -f <var>file</var>
 $ cvs commit -r 1.8 <var>file</var>
</div>

: The &lsquo;<code>-f</code>&rsquo; option disables recursion (i.e., it implies &lsquo;<code>-l</code>&rsquo;).  To force <small>CVS</small> to commit a new revision for all files in all subdirectories, you must use &lsquo;<code>-f -R</code>&rsquo;.

;<code>-m <var>message</var></code>
: Use <var>message</var> as the log message, instead of invoking an editor.


----

<div id="commit-examples"></div>
<div class="header">
<p>
Previous: [[#commit options|commit options]], Up: [[#commit&mdash;Check files into the repository|commit]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="commit-examples-1"></div>
==== commit examples ====



----

<div id="Committing-to-a-branch"></div>
<div class="header">
<p>
 &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
===== Committing to a branch =====

You can commit to a branch revision (one that has an
even number of dots) with the &lsquo;<code>-r</code>&rsquo; option.  To
create a branch revision, use the &lsquo;<code>-b</code>&rsquo; option
of the <code>rtag</code> or <code>tag</code> commands
(see [[cvs: Branching and merging#Branching and merging|Branching and merging]]).  Then, either <code>checkout</code> or
<code>update</code> can be used to base your sources on the
newly created branch.  From that point on, all
<code>commit</code> changes made within these working sources
will be automatically added to a branch revision,
thereby not disturbing main-line development in any
way.  For example, if you had to create a patch to the
1.2 version of the product, even though the 2.0 version
is already under development, you might do:

<div class="example" style="margin-left: 3.2em">
 $ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module
 $ cvs checkout -r FCS1_2_Patch product_module
 $ cd product_module
 <nowiki>[[</nowiki> hack away <nowiki>]]</nowiki>
 $ cvs commit
</div>

This works automatically since the &lsquo;<code>-r</code>&rsquo; option is
sticky.


----

<div id="Creating-the-branch-after-editing"></div>
<div class="header">
<p>
 &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
===== Creating the branch after editing =====

Say you have been working on some extremely
experimental software, based on whatever revision you
happened to checkout last week.  If others in your
group would like to work on this software with you, but
without disturbing main-line development, you could
commit your change to a new branch.  Others can then
checkout your experimental stuff and utilize the full
benefit of <small>CVS</small> conflict resolution.  The scenario might
look like:

<div class="example" style="margin-left: 3.2em">
 <nowiki>[[</nowiki> hacked sources are present <nowiki>]]</nowiki>
 $ cvs tag -b EXPR1
 $ cvs update -r EXPR1
 $ cvs commit
</div>

The <code>update</code> command will make the &lsquo;<code>-r
EXPR1</code>&rsquo; option sticky on all files.  Note that your
changes to the files will never be removed by the
<code>update</code> command.  The <code>commit</code> will
automatically commit to the correct branch, because the
&lsquo;<code>-r</code>&rsquo; is sticky.  You could also do like this:

<div class="example" style="margin-left: 3.2em">
 <nowiki>[[</nowiki> hacked sources are present <nowiki>]]</nowiki>
 $ cvs tag -b EXPR1
 $ cvs commit -r EXPR1
</div>

but then, only those files that were changed by you
will have the &lsquo;<code>-r EXPR1</code>&rsquo; sticky flag.  If you hack
away, and commit without specifying the &lsquo;<code>-r EXPR1</code>&rsquo;
flag, some files may accidentally end up on the main
trunk.

To work with you on the experimental change, others
would simply do

<div class="example" style="margin-left: 3.2em">
 $ cvs checkout -r EXPR1 whatever_module
</div>


----

<div id="diff"></div>
<div class="header">
<p>
Next: [[#export&mdash;Export sources from CVS, similar to checkout|export]], Previous: [[#commit&mdash;Check files into the repository|commit]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="diff_002d_002d_002dShow-differences-between-revisions"></div>
=== diff&mdash;Show differences between revisions ===
<div id="index-diff-_0028subcommand_0029"></div>


* Synopsis: diff <nowiki>[</nowiki>-lR<nowiki>]</nowiki> <nowiki>[</nowiki>-k kflag<nowiki>]</nowiki> <nowiki>[</nowiki>format_options<nowiki>]</nowiki> <nowiki>[[</nowiki>-r rev1 | -D date1<nowiki>]</nowiki> <nowiki>[</nowiki>-r rev2 |  -D date2<nowiki>]]</nowiki> <nowiki>[</nowiki>files&hellip;<nowiki>]</nowiki>

* Requires: working directory, repository.

* Changes: nothing.

The <code>diff</code> command is used to compare different
revisions of files.  The default action is to compare
your working files with the revisions they were based
on, and report any differences that are found.

If any file names are given, only those files are
compared.  If any directories are given, all files
under them will be compared.

The exit status for diff is different than for other
<small>CVS</small> commands; for details [[#CVS&rsquo;s exit status|Exit status]].

<div class="menu-preformatted" style="font-family: serif">
 [[#diff options|&bull; diff options]]::                diff options
 [[#diff examples|&bull; diff examples]]::               diff examples
</div>


----

<div id="diff-options"></div>
<div class="header">
<p>
Next: [[#diff examples|diff examples]], Up: [[#diff&mdash;Show differences between revisions|diff]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="diff-options-1"></div>
==== diff options ====

These standard options are supported by <code>diff</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-D <var>date</var></code>
: Use the most recent revision no later than <var>date</var>. See &lsquo;<code>-r</code>&rsquo; for how this affects the comparison.

;<code>-k <var>kflag</var></code>
: Process keywords according to <var>kflag</var>.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]].

;<code>-l</code>
: Local; run only in current working directory.

;<code>-R</code>
: Examine directories recursively.  This option is on by default.

;<code>-r <var>tag</var></code>
: Compare with revision <var>tag</var>.  Zero, one or two &lsquo;<code>-r</code>&rsquo; options can be present.  With no &lsquo;<code>-r</code>&rsquo; option, the working file will be compared with the revision it was based on.  With one &lsquo;<code>-r</code>&rsquo;, that revision will be compared to your current working file. With two &lsquo;<code>-r</code>&rsquo; options those two revisions will be compared (and your working file will not affect the outcome in any way).

: One or both &lsquo;<code>-r</code>&rsquo; options can be replaced by a &lsquo;<code>-D <var>date</var></code>&rsquo; option, described above.

The following options specify the format of the
output.  They have the same meaning as in GNU diff.
Most options have two equivalent names, one of which is a single letter
preceded by &lsquo;<code>-</code>&rsquo;, and the other of which is a long name preceded by
&lsquo;<code>--</code>&rsquo;.

;&lsquo;<code>-<var>lines</var></code>&rsquo;
: Show <var>lines</var> (an integer) lines of context.  This option does not specify an output format by itself; it has no effect unless it is combined with &lsquo;<code>-c</code>&rsquo; or &lsquo;<code>-u</code>&rsquo;.  This option is obsolete.  For proper operation, <code>patch</code> typically needs at least two lines of context.

;&lsquo;<code>-a</code>&rsquo;
: Treat all files as text and compare them line-by-line, even if they do not seem to be text.

;&lsquo;<code>-b</code>&rsquo;
: Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent.

;&lsquo;<code>-B</code>&rsquo;
: Ignore changes that just insert or delete blank lines.

;&lsquo;<code>--binary</code>&rsquo;
: Read and write data in binary mode.

;&lsquo;<code>--brief</code>&rsquo;
: Report only whether the files differ, not the details of the differences.

;&lsquo;<code>-c</code>&rsquo;
: Use the context output format.

;&lsquo;<code>-C <var>lines</var></code>&rsquo;
;&lsquo;<code>--context<span class="roman" style="font-family:serif; font-weight:normal"><nowiki>[</nowiki></span>=<var>lines</var><span class="roman" style="font-family:serif; font-weight:normal"><nowiki>]</nowiki></span></code>&rsquo;
: Use the context output format, showing <var>lines</var> (an integer) lines of context, or three if <var>lines</var> is not given. For proper operation, <code>patch</code> typically needs at least two lines of context.

;&lsquo;<code>--changed-group-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a line group containing differing lines from both files in if-then-else format.  See [[#Line group formats|Line group formats]].

;&lsquo;<code>-d</code>&rsquo;
: Change the algorithm to perhaps find a smaller set of changes.  This makes <code>diff</code> slower (sometimes much slower).

;&lsquo;<code>-e</code>&rsquo;
;&lsquo;<code>--ed</code>&rsquo;
: Make output that is a valid <code>ed</code> script.

;&lsquo;<code>--expand-tabs</code>&rsquo;
: Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.

;&lsquo;<code>-f</code>&rsquo;
: Make output that looks vaguely like an <code>ed</code> script but has changes in the order they appear in the file.

;&lsquo;<code>-F <var>regexp</var></code>&rsquo;
: In context and unified format, for each hunk of differences, show some of the last preceding line that matches <var>regexp</var>.

;&lsquo;<code>--forward-ed</code>&rsquo;
: Make output that looks vaguely like an <code>ed</code> script but has changes in the order they appear in the file.

;&lsquo;<code>-H</code>&rsquo;
: Use heuristics to speed handling of large files that have numerous scattered small changes.

;&lsquo;<code>--horizon-lines=<var>lines</var></code>&rsquo;
: Do not discard the last <var>lines</var> lines of the common prefix and the first <var>lines</var> lines of the common suffix.

;&lsquo;<code>-i</code>&rsquo;
: Ignore changes in case; consider upper- and lower-case letters equivalent.

;&lsquo;<code>-I <var>regexp</var></code>&rsquo;
: Ignore changes that just insert or delete lines that match <var>regexp</var>.

;&lsquo;<code>--ifdef=<var>name</var></code>&rsquo;
: Make merged if-then-else output using <var>name</var>.

;&lsquo;<code>--ignore-all-space</code>&rsquo;
: Ignore white space when comparing lines.

;&lsquo;<code>--ignore-blank-lines</code>&rsquo;
: Ignore changes that just insert or delete blank lines.

;&lsquo;<code>--ignore-case</code>&rsquo;
: Ignore changes in case; consider upper- and lower-case to be the same.

;&lsquo;<code>--ignore-matching-lines=<var>regexp</var></code>&rsquo;
: Ignore changes that just insert or delete lines that match <var>regexp</var>.

;&lsquo;<code>--ignore-space-change</code>&rsquo;
: Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent.

;&lsquo;<code>--initial-tab</code>&rsquo;
: Output a tab rather than a space before the text of a line in normal or context format.  This causes the alignment of tabs in the line to look normal.

;&lsquo;<code>-L <var>label</var></code>&rsquo;
: Use <var>label</var> instead of the file name in the context format and unified format headers.

;&lsquo;<code>--label=<var>label</var></code>&rsquo;
: Use <var>label</var> instead of the file name in the context format and unified format headers.

;&lsquo;<code>--left-column</code>&rsquo;
: Print only the left column of two common lines in side by side format.

;&lsquo;<code>--line-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output all input lines in if-then-else format. See [[#Line formats|Line formats]].

;&lsquo;<code>--minimal</code>&rsquo;
: Change the algorithm to perhaps find a smaller set of changes.  This makes <code>diff</code> slower (sometimes much slower).

;&lsquo;<code>-n</code>&rsquo;
: Output RCS-format diffs; like &lsquo;<code>-f</code>&rsquo; except that each command specifies the number of lines affected.

;&lsquo;<code>-N</code>&rsquo;
;&lsquo;<code>--new-file</code>&rsquo;
: In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.

;&lsquo;<code>--new-group-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a group of lines taken from just the second file in if-then-else format.  See [[#Line group formats|Line group formats]].

;&lsquo;<code>--new-line-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a line taken from just the second file in if-then-else format.  See [[#Line formats|Line formats]].

;&lsquo;<code>--old-group-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a group of lines taken from just the first file in if-then-else format.  See [[#Line group formats|Line group formats]].

;&lsquo;<code>--old-line-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a line taken from just the first file in if-then-else format.  See [[#Line formats|Line formats]].

;&lsquo;<code>-p</code>&rsquo;
: Show which C function each change is in.

;&lsquo;<code>--rcs</code>&rsquo;
: Output RCS-format diffs; like &lsquo;<code>-f</code>&rsquo; except that each command specifies the number of lines affected.

;&lsquo;<code>--report-identical-files</code>&rsquo;
;&lsquo;<code>-s</code>&rsquo;
: Report when two files are the same.

;&lsquo;<code>--show-c-function</code>&rsquo;
: Show which C function each change is in.

;&lsquo;<code>--show-function-line=<var>regexp</var></code>&rsquo;
: In context and unified format, for each hunk of differences, show some of the last preceding line that matches <var>regexp</var>.

;&lsquo;<code>--side-by-side</code>&rsquo;
: Use the side by side output format.

;&lsquo;<code>--speed-large-files</code>&rsquo;
: Use heuristics to speed handling of large files that have numerous scattered small changes.

;&lsquo;<code>--suppress-common-lines</code>&rsquo;
: Do not print common lines in side by side format.

;&lsquo;<code>-t</code>&rsquo;
: Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.

;&lsquo;<code>-T</code>&rsquo;
: Output a tab rather than a space before the text of a line in normal or context format.  This causes the alignment of tabs in the line to look normal.

;&lsquo;<code>--text</code>&rsquo;
: Treat all files as text and compare them line-by-line, even if they do not appear to be text.

;&lsquo;<code>-u</code>&rsquo;
: Use the unified output format.

;&lsquo;<code>--unchanged-group-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a group of common lines taken from both files in if-then-else format.  See [[#Line group formats|Line group formats]].

;&lsquo;<code>--unchanged-line-format=<var>format</var></code>&rsquo;
: Use <var>format</var> to output a line common to both files in if-then-else format.  See [[#Line formats|Line formats]].

;&lsquo;<code>-U <var>lines</var></code>&rsquo;
;&lsquo;<code>--unified<span class="roman" style="font-family:serif; font-weight:normal"><nowiki>[</nowiki></span>=<var>lines</var><span class="roman" style="font-family:serif; font-weight:normal"><nowiki>]</nowiki></span></code>&rsquo;
: Use the unified output format, showing <var>lines</var> (an integer) lines of context, or three if <var>lines</var> is not given. For proper operation, <code>patch</code> typically needs at least two lines of context.

;&lsquo;<code>-w</code>&rsquo;
: Ignore white space when comparing lines.

;&lsquo;<code>-W <var>columns</var></code>&rsquo;
;&lsquo;<code>--width=<var>columns</var></code>&rsquo;
: Use an output width of <var>columns</var> in side by side format.

;&lsquo;<code>-y</code>&rsquo;
: Use the side by side output format.

<div class="menu-preformatted" style="font-family: serif">
 [[#Line group formats|&bull; Line group formats]]::          Line group formats
 [[#Line formats|&bull; Line formats]]::                Line formats
</div>


----

<div id="Line-group-formats"></div>
<div class="header">
<p>
Next: [[#Line formats|Line formats]], Up: [[#diff options|diff options]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Line-group-formats-1"></div>
===== Line group formats =====

Line group formats let you specify formats suitable for many
applications that allow if-then-else input, including programming
languages and text formatting languages.  A line group format specifies
the output format for a contiguous group of similar lines.

For example, the following command compares the TeX file &lsquo;<tt>myfile</tt>&rsquo;
with the original version from the repository,
and outputs a merged file in which old regions are
surrounded by &lsquo;<code>\begin<nowiki>{</nowiki>em<nowiki>}</nowiki></code>&rsquo;-&lsquo;<code>\end<nowiki>{</nowiki>em<nowiki>}</nowiki></code>&rsquo; lines, and new
regions are surrounded by &lsquo;<code>\begin<nowiki>{</nowiki>bf<nowiki>}</nowiki></code>&rsquo;-&lsquo;<code>\end<nowiki>{</nowiki>bf<nowiki>}</nowiki></code>&rsquo; lines.

<div class="example" style="margin-left: 3.2em">
 cvs diff \
    --old-group-format='\begin<nowiki>{</nowiki>em<nowiki>}</nowiki>
 %&lt;\end<nowiki>{</nowiki>em<nowiki>}</nowiki>
 ' \
    --new-group-format='\begin<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 %&gt;\end<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 ' \
    myfile
</div>

The following command is equivalent to the above example, but it is a
little more verbose, because it spells out the default line group formats.

<div class="example" style="margin-left: 3.2em">
 cvs diff \
    --old-group-format='\begin<nowiki>{</nowiki>em<nowiki>}</nowiki>
 %&lt;\end<nowiki>{</nowiki>em<nowiki>}</nowiki>
 ' \
    --new-group-format='\begin<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 %&gt;\end<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 ' \
    --unchanged-group-format='%=' \
    --changed-group-format='\begin<nowiki>{</nowiki>em<nowiki>}</nowiki>
 %&lt;\end<nowiki>{</nowiki>em<nowiki>}</nowiki>
 \begin<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 %&gt;\end<nowiki>{</nowiki>bf<nowiki>}</nowiki>
 ' \
    myfile
</div>

Here is a more advanced example, which outputs a diff listing with
headers containing line numbers in a &ldquo;plain English&rdquo; style.

<div class="example" style="margin-left: 3.2em">
 cvs diff \
    --unchanged-group-format=<nowiki>''</nowiki> \
    --old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
 %&lt;' \
    --new-group-format='-------- %dN line%(N=1?:s) added after %de:
 %&gt;' \
    --changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
 %&lt;-------- to:
 %&gt;' \
    myfile
</div>

To specify a line group format, use one of the options
listed below.  You can specify up to four line group formats, one for
each kind of line group.  You should quote <var>format</var>, because it
typically contains shell metacharacters.

;&lsquo;<code>--old-group-format=<var>format</var></code>&rsquo;
: These line groups are hunks containing only lines from the first file. The default old group format is the same as the changed group format if it is specified; otherwise it is a format that outputs the line group as-is.

;&lsquo;<code>--new-group-format=<var>format</var></code>&rsquo;
: These line groups are hunks containing only lines from the second file.  The default new group format is same as the changed group format if it is specified; otherwise it is a format that outputs the line group as-is.

;&lsquo;<code>--changed-group-format=<var>format</var></code>&rsquo;
: These line groups are hunks containing lines from both files.  The default changed group format is the concatenation of the old and new group formats.

;&lsquo;<code>--unchanged-group-format=<var>format</var></code>&rsquo;
: These line groups contain lines common to both files.  The default unchanged group format is a format that outputs the line group as-is.

In a line group format, ordinary characters represent themselves;
conversion specifications start with &lsquo;<code>%</code>&rsquo; and have one of the
following forms.

;&lsquo;<code>%&lt;</code>&rsquo;
: stands for the lines from the first file, including the trailing newline. Each line is formatted according to the old line format (see [[#Line formats|Line formats]]).

;&lsquo;<code>%&gt;</code>&rsquo;
: stands for the lines from the second file, including the trailing newline. Each line is formatted according to the new line format.

;&lsquo;<code>%=</code>&rsquo;
: stands for the lines common to both files, including the trailing newline. Each line is formatted according to the unchanged line format.

;&lsquo;<code>%%</code>&rsquo;
: stands for &lsquo;<code>%</code>&rsquo;.

;&lsquo;<code>%c'<var>C</var>'</code>&rsquo;
: where <var>C</var> is a single character, stands for <var>C</var>. <var>C</var> may not be a backslash or an apostrophe. For example, &lsquo;<code>%c':'</code>&rsquo; stands for a colon, even inside the then-part of an if-then-else format, which a colon would normally terminate.

;&lsquo;<code>%c'\<var>O</var>'</code>&rsquo;
: where <var>O</var> is a string of 1, 2, or 3 octal digits, stands for the character with octal code <var>O</var>. For example, &lsquo;<code>%c'\0'</code>&rsquo; stands for a null character.

;&lsquo;<code><var>F</var><var>n</var></code>&rsquo;
: where <var>F</var> is a <code>printf</code> conversion specification and <var>n</var> is one of the following letters, stands for <var>n</var>&rsquo;s value formatted with <var>F</var>.

:;&lsquo;<code>e</code>&rsquo;
:: The line number of the line just before the group in the old file.

:;&lsquo;<code>f</code>&rsquo;
:: The line number of the first line in the group in the old file; equals <var>e</var> + 1.

:;&lsquo;<code>l</code>&rsquo;
:: The line number of the last line in the group in the old file.

:;&lsquo;<code>m</code>&rsquo;
:: The line number of the line just after the group in the old file; equals <var>l</var> + 1.

:;&lsquo;<code>n</code>&rsquo;
:: The number of lines in the group in the old file; equals <var>l</var> - <var>f</var> + 1.

:;&lsquo;<code>E, F, L, M, N</code>&rsquo;
:: Likewise, for lines in the new file.


: The <code>printf</code> conversion specification can be &lsquo;<code>%d</code>&rsquo;, &lsquo;<code>%o</code>&rsquo;, &lsquo;<code>%x</code>&rsquo;, or &lsquo;<code>%X</code>&rsquo;, specifying decimal, octal, lower case hexadecimal, or upper case hexadecimal output respectively.  After the &lsquo;<code>%</code>&rsquo; the following options can appear in sequence: a &lsquo;<code>-</code>&rsquo; specifying left-justification; an integer specifying the minimum field width; and a period followed by an optional integer specifying the minimum number of digits. For example, &lsquo;<code>%5dN</code>&rsquo; prints the number of new lines in the group in a field of width 5 characters, using the <code>printf</code> format <code>&quot;%5d&quot;</code>.

;&lsquo;<code>(<var>A</var>=<var>B</var>?<var>T</var>:<var>E</var>)</code>&rsquo;
: If <var>A</var> equals <var>B</var> then <var>T</var> else <var>E</var>. <var>A</var> and <var>B</var> are each either a decimal constant or a single letter interpreted as above. This format spec is equivalent to <var>T</var> if <var>A</var>&rsquo;s value equals <var>B</var>&rsquo;s; otherwise it is equivalent to <var>E</var>.

: For example, &lsquo;<code>%(N=0?no:%dN) line%(N=1?:s)</code>&rsquo; is equivalent to &lsquo;<code>no lines</code>&rsquo; if <var>N</var> (the number of lines in the group in the new file) is 0, to &lsquo;<code>1 line</code>&rsquo; if <var>N</var> is 1, and to &lsquo;<code>%dN lines</code>&rsquo; otherwise.


----

<div id="Line-formats"></div>
<div class="header">
<p>
Previous: [[#Line group formats|Line group formats]], Up: [[#diff options|diff options]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="Line-formats-1"></div>
===== Line formats =====

Line formats control how each line taken from an input file is
output as part of a line group in if-then-else format.

For example, the following command outputs text with a one-column
change indicator to the left of the text.  The first column of output
is &lsquo;<code>-</code>&rsquo; for deleted lines, &lsquo;<code>|</code>&rsquo; for added lines, and a space
for unchanged lines.  The formats contain newline characters where
newlines are desired on output.

<div class="example" style="margin-left: 3.2em">
 cvs diff \
    --old-line-format='-%l
 ' \
    --new-line-format='|%l
 ' \
    --unchanged-line-format=' %l
 ' \
    myfile
</div>

To specify a line format, use one of the following options.  You should
quote <var>format</var>, since it often contains shell metacharacters.

;&lsquo;<code>--old-line-format=<var>format</var></code>&rsquo;
: formats lines just from the first file.

;&lsquo;<code>--new-line-format=<var>format</var></code>&rsquo;
: formats lines just from the second file.

;&lsquo;<code>--unchanged-line-format=<var>format</var></code>&rsquo;
: formats lines common to both files.

;&lsquo;<code>--line-format=<var>format</var></code>&rsquo;
: formats all lines; in effect, it sets all three above options simultaneously.

In a line format, ordinary characters represent themselves;
conversion specifications start with &lsquo;<code>%</code>&rsquo; and have one of the
following forms.

;&lsquo;<code>%l</code>&rsquo;
: stands for the contents of the line, not counting its trailing newline (if any).  This format ignores whether the line is incomplete.

;&lsquo;<code>%L</code>&rsquo;
: stands for the contents of the line, including its trailing newline (if any).  If a line is incomplete, this format preserves its incompleteness.

;&lsquo;<code>%%</code>&rsquo;
: stands for &lsquo;<code>%</code>&rsquo;.

;&lsquo;<code>%c'<var>C</var>'</code>&rsquo;
: where <var>C</var> is a single character, stands for <var>C</var>. <var>C</var> may not be a backslash or an apostrophe. For example, &lsquo;<code>%c':'</code>&rsquo; stands for a colon.

;&lsquo;<code>%c'\<var>O</var>'</code>&rsquo;
: where <var>O</var> is a string of 1, 2, or 3 octal digits, stands for the character with octal code <var>O</var>. For example, &lsquo;<code>%c'\0'</code>&rsquo; stands for a null character.

;&lsquo;<code><var>F</var>n</code>&rsquo;
: where <var>F</var> is a <code>printf</code> conversion specification, stands for the line number formatted with <var>F</var>. For example, &lsquo;<code>%.5dn</code>&rsquo; prints the line number using the <code>printf</code> format <code>&quot;%.5d&quot;</code>.  See [[#Line group formats|Line group formats]], for more about printf conversion specifications.


The default line format is &lsquo;<code>%l</code>&rsquo; followed by a newline character.

If the input contains tab characters and it is important that they line
up on output, you should ensure that &lsquo;<code>%l</code>&rsquo; or &lsquo;<code>%L</code>&rsquo; in a line
format is just after a tab stop (e.g. by preceding &lsquo;<code>%l</code>&rsquo; or
&lsquo;<code>%L</code>&rsquo; with a tab character), or you should use the &lsquo;<code>-t</code>&rsquo; or
&lsquo;<code>--expand-tabs</code>&rsquo; option.

Taken together, the line and line group formats let you specify many
different formats.  For example, the following command uses a format
similar to <code>diff</code>&rsquo;s normal format.  You can tailor this command
to get fine control over <code>diff</code>&rsquo;s output.

<div class="example" style="margin-left: 3.2em">
 cvs diff \
    --old-line-format='&lt; %l
 ' \
    --new-line-format='&gt; %l
 ' \
    --old-group-format='%df%(f=l?:,%dl)d%dE
 %&lt;' \
    --new-group-format='%dea%dF%(F=L?:,%dL)
 %&gt;' \
    --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
 %&lt;---
 %&gt;' \
    --unchanged-group-format=<nowiki>''</nowiki> \
    myfile
</div>


----

<div id="diff-examples"></div>
<div class="header">
<p>
Previous: [[#diff options|diff options]], Up: [[#diff&mdash;Show differences between revisions|diff]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="diff-examples-1"></div>
==== diff examples ====

The following line produces a Unidiff (&lsquo;<code>-u</code>&rsquo; flag)
between revision 1.14 and 1.19 of
&lsquo;<tt>backend.c</tt>&rsquo;.  Due to the &lsquo;<code>-kk</code>&rsquo; flag no
keywords are substituted, so differences that only depend
on keyword substitution are ignored.

<div class="example" style="margin-left: 3.2em">
 $ cvs diff -kk -u -r 1.14 -r 1.19 backend.c
</div>

Suppose the experimental branch EXPR1 was based on a
set of files tagged RELEASE_1_0.  To see what has
happened on that branch, the following can be used:

<div class="example" style="margin-left: 3.2em">
 $ cvs diff -r RELEASE_1_0 -r EXPR1
</div>

A command like this can be used to produce a context
diff between two releases:

<div class="example" style="margin-left: 3.2em">
 $ cvs diff -c -r RELEASE_1_0 -r RELEASE_1_1 &gt; diffs
</div>

If you are maintaining ChangeLogs, a command like the following
just before you commit your changes may help you write
the ChangeLog entry.  All local modifications that have
not yet been committed will be printed.

<div class="example" style="margin-left: 3.2em">
 $ cvs diff -u | less
</div>


----

<div id="export"></div>
<div class="header">
<p>
Next: [[#history&mdash;Show status of files and users|history]], Previous: [[#diff&mdash;Show differences between revisions|diff]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="export_002d_002d_002dExport-sources-from-CVS_002c-similar-to-checkout"></div>
=== export&mdash;Export sources from CVS, similar to checkout ===
<div id="index-export-_0028subcommand_0029"></div>


* Synopsis: export <nowiki>[</nowiki>-flNnR<nowiki>]</nowiki> <nowiki>[</nowiki>-r rev|-D date<nowiki>]</nowiki> <nowiki>[</nowiki>-k subst<nowiki>]</nowiki> <nowiki>[</nowiki>-d dir<nowiki>]</nowiki> module&hellip;

* Requires: repository.

* Changes: current directory.

This command is a variant of <code>checkout</code>; use it
when you want a copy of the source for module without
the <small>CVS</small> administrative directories.  For example, you
might use <code>export</code> to prepare source for shipment
off-site.  This command requires that you specify a
date or tag (with &lsquo;<code>-D</code>&rsquo; or &lsquo;<code>-r</code>&rsquo;), so that you
can count on reproducing the source you ship to others
(and thus it always prunes empty directories).

One often would like to use &lsquo;<code>-kv</code>&rsquo; with <code>cvs
export</code>.  This causes any keywords to be
expanded such that an import done at some other site
will not lose the keyword revision information.  But be
aware that doesn&rsquo;t handle an export containing binary
files correctly.  Also be aware that after having used
&lsquo;<code>-kv</code>&rsquo;, one can no longer use the <code>ident</code>
command (which is part of the <small>RCS</small> suite&mdash;see
ident(1)) which looks for keyword strings.  If
you want to be able to use <code>ident</code> you must not
use &lsquo;<code>-kv</code>&rsquo;.

<div class="menu-preformatted" style="font-family: serif">
 [[#export options|&bull; export options]]::              export options
</div>


----

<div id="export-options"></div>
<div class="header">
<p>
Up: [[#export&mdash;Export sources from CVS, similar to checkout|export]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="export-options-1"></div>
==== export options ====

These standard options are supported by <code>export</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-D <var>date</var></code>
: Use the most recent revision no later than <var>date</var>.

;<code>-f</code>
: If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).

;<code>-l</code>
: Local; run only in current working directory.

;<code>-n</code>
: Do not run any checkout program.

;<code>-R</code>
: Export directories recursively.  This is on by default.

;<code>-r <var>tag</var></code>
: Use revision <var>tag</var>.

In addition, these options (that are common to
<code>checkout</code> and <code>export</code>) are also supported:

;<code>-d <var>dir</var></code>
: Create a directory called <var>dir</var> for the working files, instead of using the module name. See [[#checkout options|checkout options]], for complete details on how <small>CVS</small> handles this flag.

;<code>-k <var>subst</var></code>
: Set keyword expansion mode (see [[cvs: Keyword substitution#Substitution modes|Substitution modes]]).

;<code>-N</code>
: Only useful together with &lsquo;<code>-d <var>dir</var></code>&rsquo;. See [[#checkout options|checkout options]], for complete details on how <small>CVS</small> handles this flag.



----

<div id="history"></div>
<div class="header">
<p>
Next: [[#import&mdash;Import sources into CVS, using vendor branches|import]], Previous: [[#export&mdash;Export sources from CVS, similar to checkout|export]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="history_002d_002d_002dShow-status-of-files-and-users"></div>
=== history&mdash;Show status of files and users ===
<div id="index-history-_0028subcommand_0029"></div>


* Synopsis:     history <nowiki>[</nowiki>-report<nowiki>]</nowiki> <nowiki>[</nowiki>-flags<nowiki>]</nowiki> <nowiki>[</nowiki>-options args<nowiki>]</nowiki> <nowiki>[</nowiki>files&hellip;<nowiki>]</nowiki>

* Requires: the file &lsquo;<tt>$CVSROOT/CVSROOT/history</tt>&rsquo;

* Changes: nothing.

<small>CVS</small> can keep a history file that tracks each use of the
<code>checkout</code>, <code>commit</code>, <code>rtag</code>,
<code>update</code>, and <code>release</code> commands.  You can
use <code>history</code> to display this information in
various formats.

Logging must be enabled by creating the file
&lsquo;<tt>$CVSROOT/CVSROOT/history</tt>&rsquo;.

'''Note: <code>history</code> uses &lsquo;<code>-f</code>&rsquo;, &lsquo;<code>-l</code>&rsquo;,
&lsquo;<code>-n</code>&rsquo;, and &lsquo;<code>-p</code>&rsquo; in ways that conflict with the
normal use inside <small>CVS</small> (see [[#Common command options|Common options]]).'''

<div class="menu-preformatted" style="font-family: serif">
 [[#history options|&bull; history options]]::             history options
</div>


----

<div id="history-options"></div>
<div class="header">
<p>
Up: [[#history&mdash;Show status of files and users|history]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="history-options-1"></div>
==== history options ====

Several options (shown above as &lsquo;<code>-report</code>&rsquo;)  control  what
kind of report is generated:

;<code>-c</code>
: Report on each time commit was used (i.e., each time the repository was modified).

;<code>-e</code>
: Everything (all record types).  Equivalent to specifying &lsquo;<code>-x</code>&rsquo; with all record types.  Of course, &lsquo;<code>-e</code>&rsquo; will also include record types which are added in a future version of <small>CVS</small>; if you are writing a script which can only handle certain record types, you&rsquo;ll want to specify &lsquo;<code>-x</code>&rsquo;.

;<code>-m <var>module</var></code>
: Report on a particular module.  (You can meaningfully use &lsquo;<code>-m</code>&rsquo; more than once on the command line.)

;<code>-o</code>
: Report on checked-out modules.  This is the default report type.

;<code>-T</code>
: Report on all tags.

;<code>-x <var>type</var></code>
: Extract a particular set of record types <var>type</var> from the <small>CVS</small> history.  The types are indicated by single letters, which you may specify in combination.

: Certain commands have a single record type:

:;<code>F</code>
:: release
:;<code>O</code>
:: checkout
:;<code>E</code>
:: export
:;<code>T</code>
:: rtag

: One of four record types may result from an update:

:;<code>C</code>
:: A merge was necessary but collisions were detected (requiring manual merging).
:;<code>G</code>
:: A merge was necessary and it succeeded.
:;<code>U</code>
:: A working file was copied from the repository.
:;<code>W</code>
:: The working copy of a file was deleted during update (because it was gone from the repository).

: One of three record types results from commit:

:;<code>A</code>
:: A file was added for the first time.
:;<code>M</code>
:: A file was modified.
:;<code>R</code>
:: A file was removed.

The options shown as &lsquo;<code>-flags</code>&rsquo; constrain or expand
the report without requiring option arguments:

;<code>-a</code>
: Show data for all users (the default is to show data only for the user executing <code>history</code>).

;<code>-l</code>
: Show last modification only.

;<code>-w</code>
: Show only the records for modifications done from the same working directory where <code>history</code> is executing.

The options shown as &lsquo;<code>-options <var>args</var></code>&rsquo; constrain the report
based on an argument:

;<code>-b <var>str</var></code>
: Show data back to a record containing  the  string <var>str</var>  in  either the module name, the file name, or the repository path.

;<code>-D <var>date</var></code>
: Show data since <var>date</var>.  This is slightly different from the normal use of &lsquo;<code>-D <var>date</var></code>&rsquo;, which selects the newest revision older than <var>date</var>.

;<code>-f <var>file</var></code>
: Show data for a particular file (you can specify several &lsquo;<code>-f</code>&rsquo; options on the same command line). This is equivalent to specifying the file on the command line.

;<code>-n <var>module</var></code>
: Show data for a particular module (you can specify several &lsquo;<code>-n</code>&rsquo; options on the same command line).

;<code>-p <var>repository</var></code>
: Show data for a particular source repository  (you can specify several &lsquo;<code>-p</code>&rsquo; options on the same command line).

;<code>-r <var>rev</var></code>
: Show records referring to revisions since the revision or tag named <var>rev</var> appears in individual <small>RCS</small> files.  Each <small>RCS</small> file is searched for the revision or tag.

;<code>-t <var>tag</var></code>
: Show records since tag <var>tag</var> was last added to the history file.  This differs from the &lsquo;<code>-r</code>&rsquo; flag above in that it reads only the history file, not the <small>RCS</small> files, and is much faster.

;<code>-u <var>name</var></code>
: Show records for user <var>name</var>.

;<code>-z <var>timezone</var></code>
: Show times in the selected records using the specified time zone instead of UTC.



----

<div id="import"></div>
<div class="header">
<p>
Next: [[#log&mdash;Print out log information for files|log]], Previous: [[#history&mdash;Show status of files and users|history]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="import_002d_002d_002dImport-sources-into-CVS_002c-using-vendor-branches"></div>
=== import&mdash;Import sources into CVS, using vendor branches ===
<div id="index-import-_0028subcommand_0029"></div>



* Synopsis: import <nowiki>[</nowiki>-options<nowiki>]</nowiki> repository vendortag releasetag&hellip;

* Requires: Repository, source distribution directory.

* Changes: repository.

Use <code>import</code> to incorporate an entire source
distribution from an outside source (e.g., a source
vendor) into your source repository directory.  You can
use this command both for initial creation of a
repository, and for wholesale updates to the module
from the outside source.  See [[cvs: Tracking third-party sources#Tracking third-party sources|Tracking sources]], for
a discussion on this subject.

The <var>repository</var> argument gives a directory name
(or a path to a directory) under the <small>CVS</small> root directory
for repositories; if the directory did not exist,
import creates it.

When you use import for updates to source that has been
modified in your source repository (since a prior
import), it will notify you of any files that conflict
in the two branches of development; use &lsquo;<code>checkout
-j</code>&rsquo; to reconcile the differences, as import instructs
you to do.

If <small>CVS</small> decides a file should be ignored
(see [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]]), it does not import it and prints
&lsquo;<code>I </code>&rsquo; followed by the filename (see [[#import output|import output]], for a
complete description of the output).

If the file &lsquo;<tt>$CVSROOT/CVSROOT/cvswrappers</tt>&rsquo; exists,
any file whose names match the specifications in that
file will be treated as packages and the appropriate
filtering will be performed on the file/directory
before being imported.  See [[cvs: Reference manual for Administrative files#The cvswrappers file|Wrappers]].

The outside source is saved in a first-level
branch, by default 1.1.1.  Updates are leaves of this
branch; for example, files from the first imported
collection of source will be revision 1.1.1.1, then
files from the first imported update will be revision
1.1.1.2, and so on.

At least three arguments are required.
<var>repository</var> is needed to identify the collection
of source.  <var>vendortag</var> is a tag for the entire
branch (e.g., for 1.1.1).  You must also specify at
least one <var>releasetag</var> to identify the files at
the leaves created each time you execute <code>import</code>.

Note that <code>import</code> does ''not'' change the
directory in which you invoke it.  In particular, it
does not set up that directory as a <small>CVS</small> working
directory; if you want to work with the sources import
them first and then check them out into a different
directory (see [[cvs: Overview#Getting the source|Getting the source]]).

<div class="menu-preformatted" style="font-family: serif">
 [[#import options|&bull; import options]]::              import options
 [[#import output|&bull; import output]]::               import output
 [[#import examples|&bull; import examples]]::             import examples
</div>


----

<div id="import-options"></div>
<div class="header">
<p>
Next: [[#import output|import output]], Up: [[#import&mdash;Import sources into CVS, using vendor branches|import]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="import-options-1"></div>
==== import options ====

This standard option is supported by <code>import</code>
(see [[#Common command options|Common options]], for a complete description):

;<code>-m <var>message</var></code>
: Use <var>message</var> as log information, instead of invoking an editor.

There are the following additional special options.

;<code>-b <var>branch</var></code>
: See [[cvs: Tracking third-party sources#Multiple vendor branches|Multiple vendor branches]].

;<code>-k <var>subst</var></code>
: Indicate the keyword expansion mode desired.  This setting will apply to all files created during the import, but not to any files that previously existed in the repository.  See [[cvs: Keyword substitution#Substitution modes|Substitution modes]], for a list of valid &lsquo;<code>-k</code>&rsquo; settings.

;<code>-I <var>name</var></code>
: Specify file names that should be ignored during import.  You can use this option repeatedly.  To avoid ignoring any files at all (even those ignored by default), specify &lsquo;-I !&rsquo;.

: <var>name</var> can be a file name pattern of the same type that you can specify in the &lsquo;<tt>.cvsignore</tt>&rsquo; file. See [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]].

;<code>-W <var>spec</var></code>
: Specify file names that should be filtered during import.  You can use this option repeatedly.

: <var>spec</var> can be a file name pattern of the same type that you can specify in the &lsquo;<tt>.cvswrappers</tt>&rsquo; file. See [[cvs: Reference manual for Administrative files#The cvswrappers file|Wrappers]].


----

<div id="import-output"></div>
<div class="header">
<p>
Next: [[#import examples|import examples]], Previous: [[#import options|import options]], Up: [[#import&mdash;Import sources into CVS, using vendor branches|import]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="import-output-1"></div>
==== import output ====

<code>import</code> keeps you informed of its progress by printing a line
for each file, preceded by one character indicating the status of the file:

;<code>U <var>file</var></code>
: The file already exists in the repository and has not been locally modified; a new revision has been created (if necessary).

;<code>N <var>file</var></code>
: The file is a new file which has been added to the repository.

;<code>C <var>file</var></code>
: The file already exists in the repository but has been locally modified; you will have to merge the changes.

;<code>I <var>file</var></code>
: The file is being ignored (see [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]]).

<div id="index-Symbolic-link_002c-importing"></div>
<div id="index-Link_002c-symbolic_002c-importing"></div>
;<code>L <var>file</var></code>
: The file is a symbolic link; <code>cvs import</code> ignores symbolic links. People periodically suggest that this behavior should be changed, but if there is a consensus on what it should be changed to, it is not apparent. (Various options in the &lsquo;<tt>modules</tt>&rsquo; file can be used to recreate symbolic links on checkout, update, etc.; see [[cvs: Reference manual for Administrative files#The modules file|modules]].)


----

<div id="import-examples"></div>
<div class="header">
<p>
Previous: [[#import output|import output]], Up: [[#import&mdash;Import sources into CVS, using vendor branches|import]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="import-examples-1"></div>
==== import examples ====

See [[cvs: Tracking third-party sources#Tracking third-party sources|Tracking sources]], and [[cvs: Starting a project with CVS#Creating a directory tree from a number of files|From files]].


----

<div id="log"></div>
<div class="header">
<p>
Next: [[#rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases|rdiff]], Previous: [[#import&mdash;Import sources into CVS, using vendor branches|import]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="log_002d_002d_002dPrint-out-log-information-for-files"></div>
=== log&mdash;Print out log information for files ===
<div id="index-log-_0028subcommand_0029"></div>


* Synopsis: log <nowiki>[</nowiki>options<nowiki>]</nowiki> <nowiki>[</nowiki>files&hellip;<nowiki>]</nowiki>

* Requires: repository, working directory.

* Changes: nothing.

Display log information for files.  <code>log</code> used to
call the <small>RCS</small> utility <code>rlog</code>.  Although this
is no longer true in the current sources, this history
determines the format of the output and the options,
which are not quite in the style of the other <small>CVS</small>
commands.

<div id="index-Timezone_002c-in-output"></div>
<div id="index-Zone_002c-time_002c-in-output"></div>
The output includes the location of the <small>RCS</small> file,
the <em>head</em> revision (the latest revision on the
trunk), all symbolic names (tags) and some other
things.  For each revision, the revision number, the
author, the number of lines added/deleted and the log
message are printed.  All times are displayed in
Coordinated Universal Time (UTC).  (Other parts of
<small>CVS</small> print times in the local timezone).

'''Note: <code>log</code> uses &lsquo;<code>-R</code>&rsquo; in a way that conflicts
with the normal use inside <small>CVS</small> (see [[#Common command options|Common options]]).'''

<div class="menu-preformatted" style="font-family: serif">
 [[#log options|&bull; log options]]::                 log options
 [[#log examples|&bull; log examples]]::                log examples
</div>


----

<div id="log-options"></div>
<div class="header">
<p>
Next: [[#log examples|log examples]], Up: [[#log&mdash;Print out log information for files|log]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="log-options-1"></div>
==== log options ====

By default, <code>log</code> prints all information that is
available.  All other options restrict the output.

;<code>-b</code>
: Print information about the revisions on the default branch, normally the highest branch on the trunk.

;<code>-d <var>dates</var></code>
: Print information about revisions with a checkin date/time in the range given by the semicolon-separated list of dates.  The date formats accepted are those accepted by the &lsquo;<code>-D</code>&rsquo; option to many other <small>CVS</small> commands (see [[#Common command options|Common options]]). Dates can be combined into ranges as follows:

:;<code><var>d1</var>&lt;<var>d2</var></code>
:;<code><var>d2</var>&gt;<var>d1</var></code>
:: Select the revisions that were deposited between <var>d1</var> and <var>d2</var>.

:;<code>&lt;<var>d</var></code>
:;<code><var>d</var>&gt;</code>
:: Select all revisions dated <var>d</var> or earlier.

:;<code><var>d</var>&lt;</code>
:;<code>&gt;<var>d</var></code>
:: Select all revisions dated <var>d</var> or later.

:;<code><var>d</var></code>
:: Select the single, latest revision dated <var>d</var> or earlier.

: The &lsquo;<code>&gt;</code>&rsquo; or &lsquo;<code>&lt;</code>&rsquo; characters may be followed by &lsquo;<code>=</code>&rsquo; to indicate an inclusive range rather than an exclusive one.

: Note that the separator is a semicolon (;).

;<code>-h</code>
: Print only the name of the <small>RCS</small> file, name of the file in the working directory, head, default branch, access list, locks, symbolic names, and suffix.

;<code>-l</code>
: Local; run only in current working directory.  (Default is to run recursively).

;<code>-N</code>
: Do not print the list of tags for this file.  This option can be very useful when your site uses a lot of tags, so rather than &quot;more&quot;&rsquo;ing over 3 pages of tag information, the log information is presented without tags at all.

;<code>-R</code>
: Print only the name of the <small>RCS</small> file.

;<code>-r<var>revisions</var></code>
: Print information about revisions given in the comma-separated list <var>revisions</var> of revisions and ranges.  The following table explains the available range formats:

:;<code><var>rev1</var>:<var>rev2</var></code>
:: Revisions <var>rev1</var> to <var>rev2</var> (which must be on the same branch).

:;<code><var>rev1</var>::<var>rev2</var></code>
:: The same, but excluding <var>rev1</var>.

:;<code>:<var>rev</var></code>
:;<code>::<var>rev</var></code>
:: Revisions from the beginning of the branch up to and including <var>rev</var>.

:;<code><var>rev</var>:</code>
:: Revisions starting with <var>rev</var> to the end of the branch containing <var>rev</var>.

:;<code><var>rev</var>::</code>
:: Revisions starting just after <var>rev</var> to the end of the branch containing <var>rev</var>.

:;<code><var>branch</var></code>
:: An argument that is a branch means all revisions on that branch.

:;<code><var>branch1</var>:<var>branch2</var></code>
:;<code><var>branch1</var>::<var>branch2</var></code>
:: A range of branches means all revisions on the branches in that range.

:;<code><var>branch</var>.</code>
:: The latest revision in <var>branch</var>.

: A bare &lsquo;<code>-r</code>&rsquo; with no revisions means the latest revision on the default branch, normally the trunk. There can be no space between the &lsquo;<code>-r</code>&rsquo; option and its argument.

;<code>-S</code>
: Suppress the header if no revisions are selected.

;<code>-s <var>states</var></code>
: Print information about revisions whose state attributes match one of the states given in the comma-separated list <var>states</var>.

;<code>-t</code>
: Print the same as &lsquo;<code>-h</code>&rsquo;, plus the descriptive text.

;<code>-w<var>logins</var></code>
: Print information about revisions checked in by users with login names appearing in the comma-separated list <var>logins</var>.  If <var>logins</var> is omitted, the user&rsquo;s login is assumed.  There can be no space between the &lsquo;<code>-w</code>&rsquo; option and its argument.

<code>log</code> prints the intersection of the revisions
selected with the options &lsquo;<code>-d</code>&rsquo;, &lsquo;<code>-s</code>&rsquo;, and
&lsquo;<code>-w</code>&rsquo;, intersected with the union of the revisions
selected by &lsquo;<code>-b</code>&rsquo; and &lsquo;<code>-r</code>&rsquo;.


----

<div id="log-examples"></div>
<div class="header">
<p>
Previous: [[#log options|log options]], Up: [[#log&mdash;Print out log information for files|log]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="log-examples-1"></div>
==== log examples ====

Contributed examples are gratefully accepted.


----

<div id="rdiff"></div>
<div class="header">
<p>
Next: [[#release&mdash;Indicate that a Module is no longer in use|release]], Previous: [[#log&mdash;Print out log information for files|log]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="rdiff_002d_002d_002d_0027patch_0027-format-diffs-between-releases"></div>
=== rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases ===
<div id="index-rdiff-_0028subcommand_0029"></div>


* rdiff <nowiki>[</nowiki>-flags<nowiki>]</nowiki> <nowiki>[</nowiki>-V vn<nowiki>]</nowiki> <nowiki>[</nowiki>-r t|-D d <nowiki>[</nowiki>-r t2|-D d2<nowiki>]]</nowiki> modules&hellip;

* Requires: repository.

* Changes: nothing.

* Synonym: patch

Builds a Larry Wall format patch(1) file between two
releases, that can be fed directly into the <code>patch</code>
program to bring an old release up-to-date with the new
release.  (This is one of the few <small>CVS</small> commands that
operates directly from the repository, and doesn&rsquo;t
require a prior checkout.) The diff output is sent to
the standard output device.

You can specify (using the standard &lsquo;<code>-r</code>&rsquo; and
&lsquo;<code>-D</code>&rsquo; options) any combination of one or two
revisions or dates.  If only one revision or date is
specified, the patch file reflects differences between
that revision or date and the current head revisions in
the <small>RCS</small> file.

Note that if the software release affected is contained
in more than one directory, then it may be necessary to
specify the &lsquo;<code>-p</code>&rsquo; option to the <code>patch</code> command when
patching the old sources, so that <code>patch</code> is able to find
the files that are located in other directories.

<div class="menu-preformatted" style="font-family: serif">
 [[#rdiff options|&bull; rdiff options]]::               rdiff options
 [[#rdiff examples|&bull; rdiff examples]]::              rdiff examples
</div>


----

<div id="rdiff-options"></div>
<div class="header">
<p>
Next: [[#rdiff examples|rdiff examples]], Up: [[#rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases|rdiff]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="rdiff-options-1"></div>
==== rdiff options ====

These standard options are supported by <code>rdiff</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-D <var>date</var></code>
: Use the most recent revision no later than <var>date</var>.

;<code>-f</code>
: If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).

;<code>-l</code>
: Local; don&rsquo;t descend subdirectories.

;<code>-R</code>
: Examine directories recursively.  This option is on by default.

;<code>-r <var>tag</var></code>
: Use revision <var>tag</var>.

In addition to the above, these options are available:

;<code>-c</code>
: Use the context diff format.  This is the default format.

;<code>-s</code>
: Create a summary change report instead of a patch.  The summary includes information about files that were changed or added between the releases.  It is sent to the standard output device.  This is useful for finding out, for example, which files have changed between two dates or revisions.

;<code>-t</code>
: A diff of the top two revisions is sent to the standard output device.  This is most useful for seeing what the last change to a file was.

;<code>-u</code>
: Use the unidiff format for the context diffs. Remember that old versions of the <code>patch</code> program can&rsquo;t handle the unidiff format, so if you plan to post this patch to the net you should probably not use &lsquo;<code>-u</code>&rsquo;.

;<code>-V <var>vn</var></code>
: Expand keywords according to the rules current in <small>RCS</small> version <var>vn</var> (the expansion format changed with <small>RCS</small> version 5).  Note that this option is no longer accepted.  <small>CVS</small> will always expand keywords the way that <small>RCS</small> version 5 does.


----

<div id="rdiff-examples"></div>
<div class="header">
<p>
Previous: [[#rdiff options|rdiff options]], Up: [[#rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases|rdiff]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="rdiff-examples-1"></div>
==== rdiff examples ====

Suppose you receive mail from <tt>foo@example.net</tt> asking for an
update from release 1.2 to 1.4 of the tc compiler.  You
have no such patches on hand, but with <small>CVS</small> that can
easily be fixed with a command such as this:

<div class="example" style="margin-left: 3.2em">
 $ cvs rdiff -c -r FOO1_2 -r FOO1_4 tc | \
 $$ Mail -s 'The patches you asked for' foo@example.net
</div>

Suppose you have made release 1.3, and forked a branch
called &lsquo;<code>R_1_3fix</code>&rsquo; for bugfixes.  &lsquo;<code>R_1_3_1</code>&rsquo;
corresponds to release 1.3.1, which was made some time
ago.  Now, you want to see how much development has been
done on the branch.  This command can be used:

<div class="example" style="margin-left: 3.2em">
 $ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name
 cvs rdiff: Diffing module-name
 File ChangeLog,v changed from revision 1.52.2.5 to 1.52.2.6
 File foo.c,v changed from revision 1.52.2.3 to 1.52.2.4
 File bar.h,v changed from revision 1.29.2.1 to 1.2
</div>


----

<div id="release"></div>
<div class="header">
<p>
Next: [[#update&mdash;Bring work tree in sync with repository|update]], Previous: [[#rdiff&mdash;&rsquo;patch&rsquo; format diffs between releases|rdiff]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="release_002d_002d_002dIndicate-that-a-Module-is-no-longer-in-use"></div>
=== release&mdash;Indicate that a Module is no longer in use ===
<div id="index-release-_0028subcommand_0029"></div>


* release <nowiki>[</nowiki>-d<nowiki>]</nowiki> directories&hellip;

* Requires: Working directory.

* Changes: Working directory, history log.

This command is meant to safely cancel the effect of
&lsquo;<code>cvs checkout</code>&rsquo;.  Since <small>CVS</small> doesn&rsquo;t lock files, it
isn&rsquo;t strictly necessary to use this command.  You can
always simply delete your working directory, if you
like; but you risk losing changes you may have
forgotten, and you leave no trace in the <small>CVS</small> history
file (see [[cvs: Reference manual for Administrative files#The history file|history file]]) that you&rsquo;ve abandoned your
checkout.

Use &lsquo;<code>cvs release</code>&rsquo; to avoid these problems.  This
command checks that no uncommitted changes are
present; that you are executing it from immediately
above a <small>CVS</small> working directory; and that the repository
recorded for your files is the same as the repository
defined in the module database.

If all these conditions are true, &lsquo;<code>cvs release</code>&rsquo;
leaves a record of its execution (attesting to your
intentionally abandoning your checkout) in the <small>CVS</small>
history log.

<div class="menu-preformatted" style="font-family: serif">
 [[#release options|&bull; release options]]::             release options
 [[#release output|&bull; release output]]::              release output
 [[#release examples|&bull; release examples]]::            release examples
</div>


----

<div id="release-options"></div>
<div class="header">
<p>
Next: [[#release output|release output]], Up: [[#release&mdash;Indicate that a Module is no longer in use|release]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="release-options-1"></div>
==== release options ====

The <code>release</code> command supports one command option:

;<code>-d</code>
: Delete your working copy of the file if the release succeeds.  If this flag is not given your files will remain in your working directory.

: '''WARNING:  The <code>release</code> command deletes all directories and files recursively.  This has the very serious side-effect that any directory that you have created inside your checked-out sources, and not added to the repository (using the <code>add</code> command; see [[cvs: Adding, removing, and renaming files and directories#Adding files to a directory|Adding files]]) will be silently deleted&mdash;even if it is non-empty!'''


----

<div id="release-output"></div>
<div class="header">
<p>
Next: [[#release examples|release examples]], Previous: [[#release options|release options]], Up: [[#release&mdash;Indicate that a Module is no longer in use|release]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="release-output-1"></div>
==== release output ====

Before <code>release</code> releases your sources it will
print a one-line message for any file that is not
up-to-date.

;<code>U <var>file</var></code>
;<code>P <var>file</var></code>
: There exists a newer revision of this file in the repository, and you have not modified your local copy of the file (&lsquo;<code>U</code>&rsquo; and &lsquo;<code>P</code>&rsquo; mean the same thing).

;<code>A <var>file</var></code>
: The file has been added to your private copy of the sources, but has not yet been committed to the repository.  If you delete your copy of the sources this file will be lost.

;<code>R <var>file</var></code>
: The file has been removed from your private copy of the sources, but has not yet been removed from the repository, since you have not yet committed the removal.  See [[#commit&mdash;Check files into the repository|commit]].

;<code>M <var>file</var></code>
: The file is modified in your working directory.  There might also be a newer revision inside the repository.

;<code>? <var>file</var></code>
: <var>file</var> is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files for <small>CVS</small> to ignore (see the description of the &lsquo;<code>-I</code>&rsquo; option, and see [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]]).  If you remove your working sources, this file will be lost.


----

<div id="release-examples"></div>
<div class="header">
<p>
Previous: [[#release output|release output]], Up: [[#release&mdash;Indicate that a Module is no longer in use|release]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="release-examples-1"></div>
==== release examples ====

Release the &lsquo;<tt>tc</tt>&rsquo; directory, and delete your local working copy
of the files.

<div class="example" style="margin-left: 3.2em">
 $ cd ..         # <span class="roman" style="font-family:serif; font-weight:normal">You must stand immediately above the</span>
                 # <span class="roman" style="font-family:serif; font-weight:normal">sources when you issue &lsquo;<code>cvs release</code>&rsquo;.</span>
 $ cvs release -d tc
 You have <nowiki>[</nowiki>0<nowiki>]</nowiki> altered files in this repository.
 Are you sure you want to release (and delete) directory `tc': y
 $
</div>


----

<div id="update"></div>
<div class="header">
<p>
Previous: [[#release&mdash;Indicate that a Module is no longer in use|release]], Up: [[#Guide to CVS commands|CVS commands]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="update_002d_002d_002dBring-work-tree-in-sync-with-repository"></div>
=== update&mdash;Bring work tree in sync with repository ===
<div id="index-update-_0028subcommand_0029"></div>


* update <nowiki>[</nowiki>-ACdflPpR<nowiki>]</nowiki> <nowiki>[</nowiki>-I name<nowiki>]</nowiki> <nowiki>[</nowiki>-j rev <nowiki>[</nowiki>-j rev<nowiki>]]</nowiki> <nowiki>[</nowiki>-k kflag<nowiki>]</nowiki> <nowiki>[</nowiki>-r tag|-D date<nowiki>]</nowiki> <nowiki>[</nowiki>-W spec<nowiki>]</nowiki> files&hellip;

* Requires: repository, working directory.

* Changes: working directory.

After you&rsquo;ve run checkout to create your private copy
of source from the common repository, other developers
will continue changing the central source.  From time
to time, when it is convenient in your development
process, you can use the <code>update</code> command from
within your working directory to reconcile your work
with any revisions applied to the source repository
since your last checkout or update.  Without the <code>-C</code>
option, <code>update</code> will also merge any differences
between the local copy of files and their base revisions
into any destination revisions specified with <code>-r</code>,
<code>-D</code>, or <code>-A</code>.

<div class="menu-preformatted" style="font-family: serif">
 [[#update options|&bull; update options]]::              update options
 [[#update output|&bull; update output]]::               update output
</div>


----

<div id="update-options"></div>
<div class="header">
<p>
Next: [[#update output|update output]], Up: [[#update&mdash;Bring work tree in sync with repository|update]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="update-options-1"></div>
==== update options ====

These standard options are available with <code>update</code>
(see [[#Common command options|Common options]], for a complete description of
them):

;<code>-D date</code>
: Use the most recent revision no later than <var>date</var>. This option is sticky, and implies &lsquo;<code>-P</code>&rsquo;. See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

;<code>-f</code>
: Only useful with the &lsquo;<code>-D <var>date</var></code>&rsquo; or &lsquo;<code>-r <var>tag</var></code>&rsquo; flags.  If no matching revision is found, retrieve the most recent revision (instead of ignoring the file).

;<code>-k <var>kflag</var></code>
: Process keywords according to <var>kflag</var>.  See [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]]. This option is sticky; future updates of this file in this working directory will use the same <var>kflag</var>.  The <code>status</code> command can be viewed to see the sticky options.  See [[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Invoking CVS]], for more information on the <code>status</code> command.

;<code>-l</code>
: Local; run only in current working directory.  See [[cvs: Recursive behavior#Recursive behavior|Recursive behavior]].

;<code>-P</code>
: Prune empty directories.  See [[cvs: Adding, removing, and renaming files and directories#Moving and renaming directories|Moving directories]].

;<code>-p</code>
: Pipe files to the standard output.

;<code>-R</code>
: Update directories recursively (default).  See [[cvs: Recursive behavior#Recursive behavior|Recursive behavior]].

;<code>-r rev</code>
: Retrieve revision/tag <var>rev</var>.  This option is sticky, and implies &lsquo;<code>-P</code>&rsquo;. See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

These special options are also available with
<code>update</code>.

;<code>-A</code>
: Reset any sticky tags, dates, or &lsquo;<code>-k</code>&rsquo; options. See [[cvs: Revisions#Sticky tags|Sticky tags]], for more information on sticky tags/dates.

;<code>-C</code>
: Overwrite locally modified files with clean copies from the repository (the modified file is saved in &lsquo;<tt>.#<var>file</var>.<var>revision</var></tt>&rsquo;, however).

;<code>-d</code>
: Create any directories that exist in the repository if they&rsquo;re missing from the working directory.  Normally, <code>update</code> acts only on directories and files that were already enrolled in your working directory.

: This is useful for updating directories that were created in the repository since the initial checkout; but it has an unfortunate side effect.  If you deliberately avoided certain directories in the repository when you created your working directory (either through use of a module name or by listing explicitly the files and directories you wanted on the command line), then updating with &lsquo;<code>-d</code>&rsquo; will create those directories, which may not be what you want.

;<code>-I <var>name</var></code>
: Ignore files whose names match <var>name</var> (in your working directory) during the update.  You can specify &lsquo;<code>-I</code>&rsquo; more than once on the command line to specify several files to ignore.  Use &lsquo;<code>-I !</code>&rsquo; to avoid ignoring any files at all.  See [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]], for other ways to make <small>CVS</small> ignore some files.

;<code>-W<var>spec</var></code>
: Specify file names that should be filtered during update.  You can use this option repeatedly.

: <var>spec</var> can be a file name pattern of the same type that you can specify in the &lsquo;<tt>.cvswrappers</tt>&rsquo; file. See [[cvs: Reference manual for Administrative files#The cvswrappers file|Wrappers]].

;<code>-j<var>revision</var></code>
: With two &lsquo;<code>-j</code>&rsquo; options, merge changes from the revision specified with the first &lsquo;<code>-j</code>&rsquo; option to the revision specified with the second &lsquo;<code>j</code>&rsquo; option, into the working directory.

: With one &lsquo;<code>-j</code>&rsquo; option, merge changes from the ancestor revision to the revision specified with the &lsquo;<code>-j</code>&rsquo; option, into the working directory.  The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the &lsquo;<code>-j</code>&rsquo; option.

: Note that using a single &lsquo;<code>-j <var>tagname</var></code>&rsquo; option rather than &lsquo;<code>-j <var>branchname</var></code>&rsquo; to merge changes from a branch will often not remove files which were removed on the branch. See [[cvs: Branching and merging#Merging can add or remove files|Merging adds and removals]], for more.

: In addition, each &lsquo;<code>-j</code>&rsquo; option can contain an optional date specification which, when used with branches, can limit the chosen revision to one within a specific date.  An optional date is specified by adding a colon (:) to the tag: &lsquo;<code>-j<var>Symbolic_Tag</var>:<var>Date_Specifier</var></code>&rsquo;.

: See [[cvs: Branching and merging#Branching and merging|Branching and merging]].



----

<div id="update-output"></div>
<div class="header">
<p>
Previous: [[#update options|update options]], Up: [[#update&mdash;Bring work tree in sync with repository|update]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
<div id="update-output-1"></div>
==== update output ====

<code>update</code> and <code>checkout</code> keep you informed of
their progress by printing a line for each file, preceded
by one character indicating the status of the file:

;<code>U <var>file</var></code>
: The file was brought up to date with respect to the repository.  This is done for any file that exists in the repository but not in your source, and for files that you haven&rsquo;t changed but are not the most recent versions available in the repository.

;<code>P <var>file</var></code>
: Like &lsquo;<code>U</code>&rsquo;, but the <small>CVS</small> server sends a patch instead of an entire file.  This accomplishes the same thing as &lsquo;<code>U</code>&rsquo; using less bandwidth.

;<code>A <var>file</var></code>
: The file has been added to your private copy of the sources, and will be added to the source repository when you run <code>commit</code> on the file.  This is a reminder to you that the file needs to be committed.

;<code>R <var>file</var></code>
: The file has been removed from your private copy of the sources, and will be removed from the source repository when you run <code>commit</code> on the file.  This is a reminder to you that the file needs to be committed.

;<code>M <var>file</var></code>
: The file is modified in  your  working  directory.

: &lsquo;<code>M</code>&rsquo; can indicate one of two states for a file you&rsquo;re working on: either there were no modifications to the same file in the repository, so that your file remains as you last saw it; or there were modifications in the repository as well as in your copy, but they were merged successfully, without conflict, in your working directory.

: <small>CVS</small> will print some messages if it merges your work, and a backup copy of your working file (as it looked before you ran <code>update</code>) will be made.  The exact name of that file is printed while <code>update</code> runs.

;<code>C <var>file</var></code>
<div id="index-_002e_0023-files"></div>
<div id="index-_005f_005f-files-_0028VMS_0029"></div>
: A conflict was detected while trying to merge your changes to <var>file</var> with changes from the source repository.  <var>file</var> (the copy in your working directory) is now the result of attempting to merge the two revisions; an unmodified copy of your file is also in your working directory, with the name &lsquo;<tt>.#<var>file</var>.<var>revision</var></tt>&rsquo; where <var>revision</var> is the revision that your modified file started from.  Resolve the conflict as described in [[cvs: Multiple developers#Conflicts example|Conflicts example]]. (Note that some systems automatically purge files that begin with &lsquo;<tt>.#</tt>&rsquo; if they have not been accessed for a few days.  If you intend to keep a copy of your original file, it is a very good idea to rename it.)  Under <small>VMS</small>, the file name starts with &lsquo;<tt>__</tt>&rsquo; rather than &lsquo;<tt>.#</tt>&rsquo;.

;<code>? <var>file</var></code>
: <var>file</var> is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files for <small>CVS</small> to ignore (see the description of the &lsquo;<code>-I</code>&rsquo; option, and see [[cvs: Reference manual for Administrative files#Ignoring files via cvsignore|cvsignore]]).


----

<div class="header">
<p>
Previous: [[#update options|update options]], Up: [[#update&mdash;Bring work tree in sync with repository|update]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
